If you refresh all the pivot tables at once, you can save a lot of time. Yes, that’s right. Just think like this.
You have ten pivot tables; it takes one second to refresh a single pivot table,
10 Pivots = 10 Seconds
Just like you can automate the creation of a pivot table, there are a few ways to use it to refresh it automatically.
In this post, I’m going to share with you 3-simple ways that you can use to refresh all the pivot tables and your time.
NOTE: Pivot Tables are one of the INTERMEDIATE EXCEL SKILLS.
Alert: Please note that these steps might vary slightly depending on your version of Excel.
Use the “Refresh All” Button to Update all the Pivot Tables in the Workbook
The “Refresh All” button is a simple and easy way to refresh all the pivot tables in a workbook with a single click.
- Select a Pivot Table: Navigate to one of the pivot tables in your workbook by clicking on any cell within it. This selection tells Excel that your next actions will be related to pivot tables.
- Go to the Pivot Table Analyze Tab: Look toward the top of your Excel window, where you’ll see a ribbon of different tabs. Click on the “PivotTable Analyze” tab. This tab only appears when a pivot table is selected.
- Find the Refresh Drop-Down: Within the “PivotTable Analyze” tab, look for the “Data” group. Here, you’ll find a button labeled “Refresh”.
- Choose to Refresh All: After clicking on “Refresh,” a drop-down menu will appear. This menu allows you to refresh the pivot table (selected) or all pivot tables in the workbook. To refresh all pivot tables, click on “Refresh All”.
Apart from this, you can also use the “Refresh All” button from Data Tab ➜ Connections ➜ Refresh All.
Automatically Refresh All the Pivots When You Open a Workbook
If you want to refresh all pivot tables when opening a workbook, you can use the following steps to make a one-time setup.
Below are the steps to auto-refresh all pivot tables while opening a workbook.
- To start, select any of the pivot tables from the workbook. You can choose a single cell within the pivot or select the entire pivot.
- The next step is to open the Pivot Table Options, which you can do by right-clicking and then clicking “Pivot Table Options…”.
- This will open a dialog box, and you need to go to the “Data” tab. And the data tab has a checkmark that says “Refresh Data When Opening the file.”.
Refresh Pivot Tables with a Keyboard Shortcut
Once your Excel workbook is open, you can refresh all pivot tables by pressing Ctrl + Alt + F5. This shortcut tells Excel to refresh pivot tables (All the Pivots).
When you press the keyboard shortcut, Excel will refresh pivot tables in the workbook. This may take a few moments, depending on the size of your pivot tables and your computer’s processing power.
VBA Code to Update All the Pivot Tables in a Single Click
Yes, you can use VBA to refresh all pivot tables as well.
All you have to do is use the below-mentioned code.
Sub RefreshCustomPivotTable()
With ActiveSheet
.PivotTables.RefreshTable
End With
End Sub
- With ActiveSheet: “ActiveSheet” is an object that refers to the currently active sheet in the Excel workbook. The With statement performs a series of statements on a specified object, in this case, the ActiveSheet.
- .PivotTables.RefreshTable: This line is the main action of the subroutine. It refreshes all pivot tables on the ActiveSheet. The period before PivotTables is necessary because it is being called within the With statement referring to the ActiveSheet.
- End With: This line marks the end of the With statement.
You can also assign this macro to a button for use with a single click.
Refresh Only Specific Pivot Tables with VBA
If you want to update some specific pivot tables, then you can use the VBA code below.
Sub RefreshCustomPivotTable()
With ActiveSheet
.PivotTables("PivotTable1").RefreshTable
.PivotTables("PivotTable2").RefreshTable
.PivotTables("PivotTable3").RefreshTable
.PivotTables("PivotTable4").RefreshTable
.PivotTables("PivotTable5").RefreshTable
End With
End Sub
Change the names of the pivot tables according to your workbook.
If you want to update these custom pivot tables every time you open a workbook, change the name of the macro to auto_open.
Sub auto_open()
With ActiveSheet
.PivotTables("PivotTable1").RefreshTable
.PivotTables("PivotTable2").RefreshTable
.PivotTables("PivotTable3").RefreshTable
.PivotTables("PivotTable4").RefreshTable
.PivotTables("PivotTable5").RefreshTable
End With
End Sub
Understanding the Source Data in a Pivot Table
The source data in a pivot table refers to the original data on which the pivot table is based. This could be a range of cells, a named range, or an Excel table. The source data in the pivot table includes all the rows and columns you want to analyze.
thanks! xx
I use CTRL+ALT+F5
Dear Paneet,
I’m using Excel to monitor data with Exaquantum, to refresh data I must Select all then Delete then Undo.
Could you please provide me with a simple trick to refresh my data easily.
Many thanks
Regards
Imad
not working this method
Comments:
If ‘separate’ pivot tables then simple – data refresh all is simplest
If pivot tables created ‘linked’ using same data then refresh on one pivot table sufficient to enable all associated pivot tables to be updated. (good practice)
Option to have refresh set when opening file although it appears simple solution it can and ‘does’ result in a delay in opening files, hence first option ‘data refresh all’ avoids this problem.
Actually I found it useful to add the following code added to the Worksheet Activate event for every sheet containing pivot table/s:
>>>>>>>>>>>
For Each pt In ActiveSheet.PivotTables
pt.PivotCache.refresh
Next pt
>>>>>>>>>>>>>>>>>>>>>>>>>
This is also my usual method. Means you never look at a pivot table that is out of step with the data. Pity Excel does not give you that option natively, like it does at “open” time.
I’ve had refresh issues with power query and a pivot table whereby the details of the pivot table was cleared out with your suggestions. The only option was to use power pivot. I am guessing it is a sequence thing. Have you had any experience with this?
Not Really. Which version of Excel you are using?
Tanks alot.
@Beth
There’s just a minor typo in it. “PC” needs to be on the next line, so it reads “PC.Refresh”
Sub RefreshAllPivots()
Dim PC As PivotCache
For Each PC In ActiveWorkbook.PivotCaches
PC.Refresh
Next PC
End Sub
This code:
Sub RefreshAllPivots()
Dim PC As PivotCache
For Each PC In ActiveWorkbook.PivotCachesPC
.Refresh
Next PC
End Sub
Returns “Compile error: Invalid or unqualified reference” on the .Refresh
Please check the link to “30 Pivot Table Tricks”: Page not found.
Carlos
Refresh All is just wonderful. Thanks.
I’m so glad you liked it. 🙂