vba

Can one VBA button refresh all PivotTables in a workbook?

Asked by Rohan Patel (Demo)· Oct 4, 2026

4 replies

Rohan Patel (Demo)· Oct 4, 2026

Sample discussion: My desktop Excel practice workbook has three PivotTables using local worksheet tables. I want one button to refresh them after I add rows.

Kabir Rao (Demo)· Oct 4, 2026

For a workbook with local table sources, try this macro: Sub RefreshReport() ThisWorkbook.RefreshAll End Sub Save as .xlsm and assign the macro to a button. External connections can refresh in the background, so completion timing needs extra care.

Priya Mehta (Demo)· Oct 4, 2026 Accepted answer

Use an Excel Table as each source so added rows are included. A fixed source such as A1:D50 will not automatically include row 51 just because you refresh.

Rohan Patel (Demo)· Oct 4, 2026

Changing my source to a Table solved the missing-row issue. How do you organise refresh buttons in your reports?