Hi All.
I'm trying to set up some filters on a range. I know how to do it on a PivotTable but I'm trying to replicate the below code on a simple Data range. Can you please help me on this?
FiterArr = Array("Others")
For Each Criteria In PV_2.PivotFields("Employee ID").PivotItems
If Not IsError(Application.Match(PTItm.Caption, FiterArr, 0)) Then ' check if current item is not in the filter array
PTItm.Visible = False
Else
PTItm.Visible = True
End If
Next PTItm
I'm trying to set up some filters on a range. I know how to do it on a PivotTable but I'm trying to replicate the below code on a simple Data range. Can you please help me on this?
FiterArr = Array("Others")
For Each Criteria In PV_2.PivotFields("Employee ID").PivotItems
If Not IsError(Application.Match(PTItm.Caption, FiterArr, 0)) Then ' check if current item is not in the filter array
PTItm.Visible = False
Else
PTItm.Visible = True
End If
Next PTItm