All my pivots use the same exact data source. I tried to be good about copying and pasting pivots, but I'm afraid some pivots were not created that way.
I found this code on the web:
Sub ChangePivotCache()
'pivot table tutorial by contextures.com
'change pivot cache for all Pivot Tables in workbook
Dim pt As PivotTable
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
For Each pt In wks.PivotTables
pt.CacheIndex = Sheets("ALLRATES").PivotTables(1).CacheIndex
Next pt
Next wks
End Sub
But this does not work. I'm using the sheet ALLRATES (has two pivot tables PivotTable1 and PivotTable2). I just want to make every pivot in my workbook use the same cache as PivotTable1 in the ALLRATES worksheet.
Bookmarks