I have a workbook with 20 different pivot tables. Is there any easy way to find all the pivot tables and refresh them in VBA?
Yes.
ThisWorkbook.RefreshAll
Or, if your Excel version is old enough,
Dim Sheet as WorkSheet, Pivot as PivotTable
For Each Sheet in ThisWorkbook.WorkSheets
For Each Pivot in Sheet.PivotTables
Pivot.RefreshTable
Pivot.Update
Next
Next