Hi
I'm trying to modify a filter on a pivot table field, and can't figure out what the issue is.
I did this manually, tracking it with the macro recorder, and got this code:
Sub Macro4()
' Macro4 Macro
ActiveSheet.PivotTables("pvtByClip").PivotFields("GroupDescription").ClearAllFilters
ActiveSheet.PivotTables("pvtByClip").PivotFields("GroupDescription").PivotFilters.Add _
Type:=xlValueIsGreaterThan, _
DataField:=ActiveSheet.PivotTables("pvtByClip").PivotFields("This Month"), _
Value1:=500000, _
Order:=0
End Sub
Without any mods to the code (apart from tidying up the line breaks) when I try to re-run this code - with the relevant sheet activated - I get the error happening (at the ClearAllFilters firstly).
What I'm trying to do is pass a value parameter to the code to modify the filter clip level via VBA.
I'd appreciate any pointers on how to resolve this - thanks.
Bookmarks