Glen_Marshall
New Member
- Joined
- May 6, 2014
- Messages
- 9
Hi all,
I was provided with the very useful code below that sychs the cache of my pivot tables to that of pivot table1.
I'm now after a way for all my pivot tables to have the same column lables as pivot table 1. Currently I have months from 2010 to 2014 however I need to alter that to only certain dates, therefore I woul dlike to change in on pivot table 1 and then hit some code to update the rest.
Is there a way the code can be adapted to achieve this? I'm assuming it's the CacheIndex that needs to change to something??
Many thanks
Glen
PS - using Excel 2010
I was provided with the very useful code below that sychs the cache of my pivot tables to that of pivot table1.
Code:
Sub SyncCaches()Dim MyPivot As PivotTable
Dim MySheet As Worksheet
For Each MySheet In ActiveWorkbook.Worksheets
For Each MyPivot In MySheet.PivotTables
MyPivot.CacheIndex = Sheets("Pivot Count").PivotTables("PivotTable1").CacheIndex
Next MyPivot
Next MySheet
End Sub
I'm now after a way for all my pivot tables to have the same column lables as pivot table 1. Currently I have months from 2010 to 2014 however I need to alter that to only certain dates, therefore I woul dlike to change in on pivot table 1 and then hit some code to update the rest.
Is there a way the code can be adapted to achieve this? I'm assuming it's the CacheIndex that needs to change to something??
Many thanks
Glen
PS - using Excel 2010