Hi everyone
I have a table with some data in one sheet and then a pivottable based on the data in the table in another sheet. I would like the pivot table to update every time the table is updated with some new data. The table and pivottable should remain in different sheets.
The code below only works when the table and the pivottable are in the same sheet. Can anyone help?
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("Sheet1").PivotTables("Pivottabel1").PivotCache.Refresh
End Sub
Sincerely
Christian
I have a table with some data in one sheet and then a pivottable based on the data in the table in another sheet. I would like the pivot table to update every time the table is updated with some new data. The table and pivottable should remain in different sheets.
The code below only works when the table and the pivottable are in the same sheet. Can anyone help?
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("Sheet1").PivotTables("Pivottabel1").PivotCache.Refresh
End Sub
Sincerely
Christian