vba
4 replies
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.
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.
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.
Changing my source to a Table solved the missing-row issue. How do you organise refresh buttons in your reports?