Forum Discussion
Change pivot table cache
1. Refresh the pivot table: Select the pivot table.
Click Analyze > Refresh.
If the data source has been changed, the cache will be updated automatically after refreshing.
2. To change the data source: Select the pivot table.
Click “Analyze” > “Change Data Source”.
Select the new data source range and click “OK”.
3. Clear Old Cache: Select the pivot table.
Click Analyze > Options > Data > Clear Old Cache.
4. Use VBA Script: Press Alt + F11 to open the VBA editor.
Insert a new module and enter the following code:
vba
Sub ChangePivotCache()
Dim ws As Worksheet
Dim pt As PivotTable
Dim pc As PivotCache
Set ws = ThisWorkbook.Sheets(“Sheet1”)
Set pt = ws.PivotTables(“PivotTable1”)
Set pc = ThisWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=“NewRange”)
pt.ChangePivotCache pc
pt.RefreshTable
End Sub
Run the script to change the pivot table cache and refresh it.
5. Contact Microsoft Support: If none of the above methods work, it is recommended to contact Microsoft support team with detailed error messages and screenshots for further assistance.