I have one data source sheet and 3 pivot tables that I want to all update automatically. I am getting this run-time error 1004 when I try to input a new row or make any changes. Below is the code I have for all 3 pivot tables. Can someone help me please?
Run-time error 1004 Unable to get the PivotTables properties of the worksheet class.
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("Data").PivotTables("PivotTable1").PivotCache.Refresh
Worksheets("Data").PivotTables("PivotTable2").PivotCache.Refresh
Worksheets("Data").PivotTables("PivotTable3").PivotCache.Refresh
End Sub
Run-time error 1004 Unable to get the PivotTables properties of the worksheet class.
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("Data").PivotTables("PivotTable1").PivotCache.Refresh
Worksheets("Data").PivotTables("PivotTable2").PivotCache.Refresh
Worksheets("Data").PivotTables("PivotTable3").PivotCache.Refresh
End Sub