Hi Guys,
i have pivot table like here:
Screenshot_1.png
and what i want is to add filter on values to exclude values <> 0.
Manually when i am setting this up it is working like a charm without any issues.
I recorded even macro to this via VBA but i am getting error:
Autofilter method of range class failed.
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim AddressPivot As Range
Dim strAddress As String
ActiveSheet.Range("$A$1:$C$10").AutoFilter Field:=3, Criteria1:=Array("165" _
, "22", "55", "88"), Operator:=xlFilterValues
ActiveSheet.Range("$A$1:$C$10").AutoFilter Field:=3
End Sub
Code to this is like above.
The perfect solution would be to take address from target pivot table and use it to filter specific field.
Please help,
Jacek
Bookmarks