Excel Guides

Updating Multiple PivotTables at Once in Excel

Updating multiple PivotTables at once can be a time-consuming and tedious task, especially if there are a lot of PivotTables to update. However, there are a few ways to make this process easier and faster.

One way to update multiple PivotTables at once is to use the Refresh All command. This command will refresh all PivotTables in the workbook, as well as any external data sources that are used by the PivotTables. To use the Refresh All command, go to the Data tab on the ribbon and click the Refresh All button.

Another way to update multiple PivotTables at once is to use VBA code. This method requires a bit more setup, but it can be very powerful and flexible. To use VBA code to update PivotTables, first add a reference to the Microsoft Excel Object Library. To do this, go to Tools > References in the VBA editor and check the box next to Microsoft Excel Object Library. Then, add the following code to a module:

Sub UpdatePivotTables() 

  Dim pt As PivotTable 

  For Each pt In ActiveWorkbook.PivotTables 

    pt.RefreshTable 

  Next pt 
  
End Sub

This code will loop through all of the PivotTables in the active workbook and refresh each one. To run this code, press F5 or go to Run > Run Sub/UserForm in the VBA editor.

There are a few things to keep in mind when using this method. First, make sure that all of the PivotTables that you want to update are in the same workbook as the code. Second, this method will only work if all of the data sources for the PivotTables are located on your computer; it will not work if any of the data sources are located on a network or the internet.

Move beyond 

Excel

Get started with Causal today.
Build models effortlessly, connect them directly to your data, and share them with interactive dashboards and beautiful visuals.