1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
'création du TCD
Set alfa = cible.Sheets(2)
Set oméga = cible.Sheets(1)
tablosource = alfa.[A1].CurrentRegion.Address(, , xlR1C1, True)
oméga.Cells.Clear
ThisWorkbook.PivotCaches.Add(SourceType:=xlDatabase, _
SourceData:=tablosource).CreatePivotTable _
TableDestination:="synthèse!R3C1", _
TableName:="prénom"
ActiveWorkbook.ShowPivotTableFieldList = True
With oméga.PivotTables("prénom").PivotFields("Prénoms")
.Orientation = xlRowField
.Position = 1
End With
oméga.PivotTables("prénom").AddDataField oméga. _
PivotTables("prénom").PivotFields("Nombre"), _
"par prénoms", xlSum
Application.CommandBars("PivotTable").Visible = False
ActiveWorkbook.ShowPivotTableFieldList = False |
Partager