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 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago