Tom’s Tutorials For Excel: Refreshing All Your PivotTables at Once
Here are two macros you can use for refreshing all the pivot tables on your active worksheet, or all the pivot tables in the entire worbook.
Sub RefreshAllActiveSheet() Dim Pt As PivotTable For Each Pt In ActiveSheet.PivotTables Pt.RefreshTable Next Pt End Sub Sub RefreshAllActiveWB() Dim Sh As Worksheet, Pt As PivotTable For Each Sh In Sheets For Each Pt In Sh.PivotTables Pt.RefreshTable Next Pt Next Sh End Sub
If you are new to VBA and not sure how to install macros, follow these simple steps:
There are many ways to run a macro. An easy method is to press Alt+F8 to call the Macro dialog box, select your macro's name in the window, and click the Run button, as indicated by the following pictures.