Hi guys, I need to enable multiplepageitems across all pivot tables in my workbook, however the cubefields value change from day to day, and if it is hardcoded, the change in the cubefields value will make the code not running. Is there a way to make the cubefields value autodetected? Any better coding?
Please help out.
Below is my exact code:-
Sub EnableMultiplePageItems()
ActiveSheet.PivotTables("PivotTable15").CubeFields(35).EnableMultiplePageItems = True
ActiveSheet.PivotTables("PivotTable15").PivotFields( _
"[Snapshots].[Snapshots Hierarchy].[Reference Date]").VisibleItemsList = Array("[Snapshots].[Snapshots Hierarchy].[Reference Date].&[2012-10-14T00:00:00]")
ActiveSheet.PivotTables("PivotTable15").PivotFields( "[Snapshots].[Snapshots Hierarchy].[Resultsdescription]").VisibleItemsList = Array("")
End Sub
Bookmarks