I've found this code on the internet and can't get it to work properly.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim pt As PivotTable
Set pt = Worksheets("Pivot table").PivotTables("PivotTable1")
If Intersect(Target, pt.TableRange1) Is Nothing Then
Worksheets("Pivot table").PivotTables("PivotTable1").PivotCache.Refresh
End If
End Sub
My PivotTable & Chart are on the same sheet ('data sheet') as my reference table. The reference table takes its info from 14 other sheets. When I update one of the other sheets, the reference table on the 'data sheet' updates without problem. But the PivotTable & Chart will only update if a change is manually made to the 'data sheet'.
Can someone recommend any tweaks to this code to get the PivotTable & Chart to update when changes are made on the other sheets please?
Bookmarks