Hi All,
Trying to filter a pivot field using a macro. Following is the image for the pivot table
Imgur: The most awesome images on the Internet
And below is the code that is giving me the error (In red). Thoughts??
Many thanks!
Trying to filter a pivot field using a macro. Following is the image for the pivot table
Imgur: The most awesome images on the Internet
And below is the code that is giving me the error (In red). Thoughts??
Code:
Sub TestPivot()
With ActiveSheet.PivotTables(1)
.PivotFields("Business Unit").ClearAllFilters
[COLOR=#ff0000].PivotFields("Business Unit").PivotFilters.Add Type:=xlCaptionEquals, Value1:=[C2].Value[/COLOR]
End With
End Sub
Many thanks!