Excel does not refresh pivot tables automatically by default. To make a pivot table update when the source data changes, you have three practical options: press Refresh manually (Alt+F5 or the Refresh button), turn on Refresh data when opening the file in PivotTable Options, or use a short VBA macro that refreshes on a schedule or on a worksheet change. The built-in option is the safest and works in every desktop version; VBA gives you true auto-refresh while the workbook is open. This guide walks through each method, what to watch out for, and how to fix the usual failures.
What You'll Need
- Excel for Windows or Mac (desktop). Excel for the web has limited pivot refresh options and does not support VBA.
- A pivot table already built from a data range or an Excel Table.
- For the VBA method: the workbook saved as .xlsm (macro-enabled).
- Optional: your source data formatted as an Excel Table (Ctrl+T), which makes range expansion automatic.
Step-by-Step
Method 1: Refresh when the file opens (no code)
- Click any cell inside the pivot table so the PivotTable Analyze (or Analyze) tab appears on the ribbon.
- On that tab, click PivotTable (the small arrow under Options on some versions) and choose Options. In older layouts the path is PivotTable Analyze > Options. Labels vary slightly by Excel version and platform.
- In the PivotTable Options dialog, open the Data tab.
- Tick Refresh data when opening the file.
- Click OK, then save the workbook. Every time the file is opened, Excel refreshes the pivot from its source.
This is the closest thing to native auto-update. It does not refresh while the file stays open, so pair it with a manual refresh (right-click the pivot > Refresh, or Alt+F5) after you edit data.
Method 2: Refresh on a timer with VBA
- Save the workbook as .xlsm (File > Save As > Excel Macro-Enabled Workbook).
- Press Alt+F11 to open the VBA editor.
- In the Project pane, double-click ThisWorkbook.
- Paste a short routine that refreshes all pivots and schedules itself, for example:
Private Sub Workbook_Open()thenApplication.OnTime Now + TimeValue("00:05:00"), "RefreshPivots"andEnd Sub, plus a standard module containingSub RefreshPivots()that loopsThisWorkbook.PivotCachesand calls.Refresh, then reschedules itself. - Close the editor and save. Reopen the file and enable macros when prompted.
The timer refreshes every five minutes while the workbook is open. Adjust the interval to suit your data. Macros do not run in Excel for the web, and users must enable them.
Method 3: Refresh when data changes (Worksheet_Change)
- With the workbook macro-enabled, open the VBA editor (Alt+F11).
- Double-click the sheet that holds your source data.
- Add a
Worksheet_Changeevent that callsThisWorkbook.RefreshAll. - Save and test by editing a source cell. The pivot should update within a second.
Keep this on the data sheet only. Putting it on the pivot sheet can cause refresh loops.
Method 4: Use an Excel Table as the source
- Select your data range and press Ctrl+T to create a Table.
- Rebuild or repoint the pivot to the Table name (PivotTable Analyze > Change Data Source).
- New rows typed directly below the Table are included automatically. You still need to refresh the pivot, but the range no longer needs editing.
Common Mistakes
- Expecting live updates without VBA. Native Excel only refreshes on open or manually; there is no built-in "refresh every minute" toggle.
- Leaving the source as a fixed range. New rows outside the range are ignored until you change the data source. Use a Table or a dynamic named range.
- Saving as .xlsx after adding macros. The code is stripped silently. Always keep .xlsm.
- Putting Worksheet_Change on the wrong sheet. It must sit on the data sheet, not the pivot sheet.
- Forgetting that RefreshAll also refreshes external connections, which can be slow or prompt for credentials.
- Sharing a macro workbook with web users. Excel for the web will not run the VBA.
Tips
- Use Alt+F5 to refresh the selected pivot quickly; Ctrl+Alt+F5 refreshes all connections and pivots.
- Right-click the pivot and choose PivotTable Options > Data to also tick Save source data with file if you want the cache available offline.
- If the pivot is slow, uncheck Refresh data when opening the file on large workbooks and refresh manually instead.
- Name your pivots (PivotTable Analyze > PivotTable Name) so a macro can target one instead of all.
- Test macros on a copy before rolling them out to a shared file.
Troubleshooting
- Pivot does not update on open: confirm the option is ticked in PivotTable Options > Data, the file is saved, and the source range still exists. If the source is on another workbook, that file must be available.
- Macro does not run: check the file is .xlsm, macros are enabled in the Trust Center, and the workbook is not opened in Protected View. Close and reopen from a trusted location.
- "Cannot refresh" or credentials prompt: the pivot is connected to an external source. Check the connection settings under Data > Queries & Connections and sign in again.
- New rows missing: the source range is fixed. Convert to a Table or update the data source range.
- Refresh loop or Excel freezes: remove the Worksheet_Change event from the pivot sheet, or add
Application.EnableEvents = Falsearound the refresh and set it back to True afterwards. - Web version ignores your macro: expected. Use the desktop app or refresh manually in the browser.
Frequently Asked Questions
Can Excel refresh a pivot table automatically without VBA?
Only when the file is opened, via PivotTable Options > Data > Refresh data when opening the file. There is no built-in timed refresh.
Does refreshing a pivot table change the source data?
No. Refresh reads the source and rebuilds the pivot cache; it never writes back to your data.
Why does my pivot table not pick up new rows?
The source is a fixed range. Convert the data to an Excel Table (Ctrl+T) or update the data source range, then refresh.
Will auto-refresh work in Excel for the web?
The open-file refresh option is limited and VBA does not run in the browser. Use the desktop app for reliable auto-refresh.
Can I refresh only one pivot table?
Yes. Select a cell in that pivot and press Alt+F5, or right-click and choose Refresh. Ctrl+Alt+F5 refreshes everything.
Is a macro safe to use in a shared workbook?
Only if recipients trust the source and enable macros. Otherwise use the open-file refresh option and refresh manually.