Refresh Pivot on Specific Pivot Field Change only
Greetings,
I have a pivot table setup in Excel 2003. It has 3 Page fields - Month, Week and Date.
What i was trying to accomplish is - if at all the user changes the date using the Date field, the pivot should refresh, else no action.
I have tried Worksheet_PivotTableUpdate & Worksheet_Change but didnt go far.
The following is the code i tried after researching but it wont work...
Select Code copy to clipboard
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, PivotTables("PivotTable2").PageRange.Columns(2)) Is Nothing Then
Exit Sub
Else
Application.EnableEvents = False
PivotTables("PivotTable2").PivotCache.Refresh
End If
'otherwise altered cell is a page field...
Application.EnableEvents = False
End Sub
Hence, any help on this would be greatly appreciated!!
Thank you in advance!
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago