How to Refresh Pivot Table in Excel?

Refresh Pivot Table in Excel to ensure your data analysis remains accurate and up-to-date. By regularly updating your pivot tables, you can maintain the integrity of your reports, make informed decisions based on the latest information, and adapt swiftly to new data trends. This crucial step in data management allows for dynamic reporting and timely insights, making your Excel workflows more efficient and reliable. Embrace the power of refreshing pivot tables to transform your data analysis into a robust, responsive process that consistently supports strategic business decisions.

Manually refresh Pivot Table

When the existing data source changes and you want to refresh the pivot table to reflect those changes, this approach is the best choice.

The steps to reload a pivot table are as follows

Step 1: Click the right mouse button on any Pivot Table cell and then choose “Refresh”.

Refresh Pivot Table

The Pivot Table will quickly refresh as a result.

You may also use the keyboard shortcut ALT + F5 to choose any cell in the pivot table.

Quick Tip: It is recommended to utilize an Excel Table to generate the Pivot Table after converting the data source into an Excel Table. In this case, as an Excel Table automatically takes into account newly added rows and columns, you may also utilize the refresh technique to update the Pivot Table also when additional data (rows/columns) are added to the raw data.

Refresh Pivot Table on Protected Sheet

You cannot refresh the pivot tables on a worksheet that has been protected. Right-clicking on the pivot table causes the Refresh command to become faint.

Refresh Pivot Table

Here’s how to avoid the issue

Manually: If you are aware of the password, you can manually unlock the worksheet, update the pivot table, and then re-protect it.

Macros: If you’re using a macro to update the pivot table, add code to unlock the worksheet, update the pivot table, and then lock it back. An example is shown in this macro.

Sub UnprotectRefresh()

On Error Resume Next

With Activesheet

.Unprotect Password:=”mypassword”

.PivotTables(1).RefreshTable

.Protect Password:=”mypassword”, _

AllowUsingPivotTables:=True

End With

End Sub

Refresh/Update Pivot Table by Changing the Data Source

You must update the pivot table’s source data if the number of rows and columns in your data set changes.

The procedure of refreshing Pivot Table by changing the data source:

Step 1: In the Pivot Table, choose any cell.

Refresh Pivot Table in Excel

Step 2: Click “Change Data Source” under the “Data” group on the “PivotTable Analyze” tab.

Refresh Pivot Table

Step 3: Update the range to include new data in the “Change PivotTable Data Source” dialog box. After that, click OK.

Refresh Pivot Table in Excel

You don’t need to use the change data source option if you convert the data source to an Excel table and use that table to build the pivot table. The Pivot Table will automatically account for the new rows and columns if you simply refresh it.

Auto refresh Pivot Table Using a VBA Macro

Even though it just takes two clicks to refresh a Pivot table, you still need to do it each time there is a change.

You can use a straightforward one-line VBA macro code to improve efficiency and have the Pivot Table automatically refresh anytime the data source changes.

The VBA code is as follows:

Private Sub Worksheet_Change(ByVal Target As Range)

Worksheets(“Sheet1”).PivotTables(“PivotTable1”).PivotCache.Refresh

End Sub

Deciphering the Code: This change event is triggered each time the sheet containing the source data is changed. The code updates the Pivot Cache of the Pivot Table with the name PivotTable1 whenever there is a change.

To make this code work for your workbook, you must make the following changes:

“Sheet1” should be replaced with the name of the sheet containing the pivot table in this section of the code.

Replace “PivotTable1” with the name of your pivot table. Click anywhere in the Pivot Table and select the Analyze Tab to get the name. The name would be readable under the “PivotTable Name” header in the left portion of the ribbon.

Refresh Pivot Table in Excel

Where to enter this VBA code

Step 1: Hit “Alt and F11” on your keyboard. The VB Editor window will open.

Project Explorer would be on the left in the VB Editor (that has the names of all the worksheets). Press “Control + R” to make it visible if it isn’t already.

Refresh Pivot Table in Excel

Step 2: Double-click on the name of the sheet containing the pivot table in the Project Explorer.

Copy and paste the provided code into the code window on the right, then change the pivot table’s name and sheet name as necessary.

Refresh Pivot Table in Excel

Snap the VB Editor shut. Now the Pivot Table would automatically refresh whenever you made any changes to the data source.

Note: Because the workbook contains a macro, save it with the.xls or.xlsm extension.

Application of Refresh Pivot Table in Excel

  • Update Data Source Changes: Refresh Pivot Table in Excel to reflect any changes or updates made to the underlying data source, ensuring your pivot table displays the most current information.
  • Incorporate New Data: After adding new data to your dataset, use the refresh function to update the pivot table, ensuring all new entries are included in your analysis.
  • Correct Data Discrepancies: If there are discrepancies or errors in your pivot table, refreshing can help realign the data with the source, correcting any inconsistencies.
  • Dynamic Reporting: Keep your reports up-to-date by refreshing pivot tables regularly, ensuring that reports reflect the latest data for accurate decision-making.
  • Seasonal or Periodic Analysis: Use the refresh feature to update pivot tables for periodic analyses such as monthly sales, quarterly performance reviews, or annual financial statements.
  • Automated Data Updates: If your Excel data is connected to external data sources, refreshing pivot tables becomes crucial to load the latest data automatically into your spreadsheet for real-time analysis.

For ready-to-use Dashboard Templates:

    1. Financial Dashboards
    2. Sales Dashboards
    3. HR Dashboards
    4. Data Visualization Charts

Leave a Comment

Your email address will not be published. Required fields are marked *

Categories