I need all the pivot tables in my worksheet to be updated every time I select one of my worksheets that serves as a dashboard. I used the most logical code, but I think something is missing, since the macro does not run, since it returns "compile error" for PivotTables
:
Private Sub Worksheet_Activate()
ThisWorkbook.Sheets.PivotTables.RefreshTable
End Sub