A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Right-click the sheet tab.
Select "View Code" from the context menu.
Copy the following code into the worksheet's code module:
Private Sub Worksheet_Activate()
Dim pvt As PivotTable
For Each pvt In Me.PivotTables
pvt.RefreshTable
Next pvt
End Sub
Switch back to Excel. Make sure that you enable macros when you open the workbook.