Hi everyone!
I really need some help on VBA pivot filtering.
I am trying to exclude "1099" and " *Address* " from a pivot filter called "Vendor_site_code".
Also very important, i need to clear all filters before I reapply them.
what I have so far works only for the first filter of the pivot excluding some names:
I've tried the below code also, but it says "Unable to get pivot items propriety of the pivot field class" Any ideea what I'm doing wrong ?
I really need some help on VBA pivot filtering.
I am trying to exclude "1099" and " *Address* " from a pivot filter called "Vendor_site_code".
Also very important, i need to clear all filters before I reapply them.
what I have so far works only for the first filter of the pivot excluding some names:
Code:
Sub Pay_site_is_no()
ActiveSheet.PivotTables("PivotTable10").PivotFields("VENDOR_name").ClearAllFilters
With ActiveSheet.PivotTables("PivotTable10").PivotFields("VENDOR_name")
.PivotItems("aff").Visible = False
.PivotItems("wex").Visible = False
.PivotItems("inc").Visible = False
End With
End Sub
I've tried the below code also, but it says "Unable to get pivot items propriety of the pivot field class" Any ideea what I'm doing wrong ?
Code:
ActiveSheet.PivotTables("PivotTable10").PivotFields("VENDOR_site_code").ClearAllFilters
With ActiveSheet.PivotTables("PivotTable10").PivotFields("VENDOR_site_code")
.PivotItems("1099").Visible = False
.PivotItems("*Address*").Visible = False
End With