HI ALL!!
HELP ME PLEASE!
1) I am trying to create a separate Pivot Table for each pivot items using the below code.
PivotTable Name = PivotTable_UBT
Filter Item = Building
2) Now i want to connect all the pivottables through a slicer, recording macro did the job, BUT pivot tables are
named in series i.e, PivotTable1,PivotTable2,PivotTable3.. because of this I cannot repeat the macro. Below is the recorded macro.
Slicer required for "Type"
3) Is there a way/efficient code to create pivottables for each "Building" field and slice them through "Type" ? or how can i rename each pivottables using "for each.. next" loop or something?
HELP ME PLEASE!
1) I am trying to create a separate Pivot Table for each pivot items using the below code.
PivotTable Name = PivotTable_UBT
Filter Item = Building
Code:
ActiveSheet.PivotTables("PivotTable_UBT").ShowPages PageField:="Building"
2) Now i want to connect all the pivottables through a slicer, recording macro did the job, BUT pivot tables are
named in series i.e, PivotTable1,PivotTable2,PivotTable3.. because of this I cannot repeat the macro. Below is the recorded macro.
Slicer required for "Type"
Code:
ActiveWorkbook.SlicerCaches("Slicer_Type").PivotTables.AddPivotTable ( _
ActiveSheet.PivotTables("[B]PivotTable1[/B]"))
ActiveWorkbook.SlicerCaches("Slicer_Type").PivotTables.AddPivotTable ( _
ActiveSheet.PivotTables("[B]PivotTable2[/B]"))
ActiveWorkbook.SlicerCaches("Slicer_Type").PivotTables.AddPivotTable ( _
ActiveSheet.PivotTables("[B]PivotTable3[/B]"))
3) Is there a way/efficient code to create pivottables for each "Building" field and slice them through "Type" ? or how can i rename each pivottables using "for each.. next" loop or something?