Bonjour à tous,
J'ai le code suivant
Ce code me permet de créer un tableau croisé mais j'aimerai ajouté une ligne de code afin que la somme des valeurs ne soient plus en étiquette ligne mais en étiquette colonne afin de voir l'ensemble de mes valeurs.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 Sub hyh() ThisWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _ [Export!A1].CurrentRegion.Address(, , xlR1C1, True)).CreatePivotTable _ TableDestination:="Presentation!R3C1", _ TableName:="Mon TCD", DefaultVersion:=xlPivotTableVersion10 Sheets("Presentation").Select Cells(3, 2).Select With ActiveSheet.PivotTables("Mon TCD").PivotFields("Type d'immo.") .Orientation = xlRowField .Position = 1 End With With ActiveSheet.PivotTables("Mon TCD").PivotFields("Designation de l'immobilisation 2") .Orientation = xlRowField .Position = 2 End With With ActiveSheet.PivotTables("Mon TCD").PivotFields("2013") .Orientation = xlDataField .Function = xlSum .Position = 1 End With With ActiveSheet.PivotTables("Mon TCD").PivotFields("2014") .Orientation = xlDataField .Function = xlSum .Position = 2 End With With ActiveSheet.PivotTables("Mon TCD").PivotFields("2015") .Orientation = xlDataField .Function = xlSum .Position = 2 End With End Sub
Pour faire simple je veux passer de l'image 1 à l'image 2.
Merci pour votre aide
Partager