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 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago