Professional Documents
Culture Documents
To Automatically Refresh The Data in A PivotTable Report
To Automatically Refresh The Data in A PivotTable Report
1. Press Alt+F11, and then double-click the sheet name in the VBAProject pane.
2. From the left dropdown list above the Module sheet, select Worksheet, and from the right dropdown list, select Activate.
3. Copy the code from the Macro Event Activate in the screenshot.
4. Press Ctrl+S to save the workbook, and then press Alt+F4 to close the VBE. The
PivotTable report is refreshed automatically upon selecting the sheet that contains it.
Note:
To find the PivotTable report name (in this example, PivotTable1), select a cell in the PivotTable report, right click, and then select Table
Options from the shortcut menu
Option Explicit
Private Sub Worksheet_Activate()
ActiveSheet.PivotTables("Coverage & WR").PivotCache.Refresh
End Sub