I basically want to include two things that the pivot table does not contain. In the code below it has Chev and Mac.
Am happy to do this in Excel or in VBA.
ActiveSheet.PivotTables("PivotTable4").PivotFields("Traders Name"). _
ClearLabelFilters
ActiveSheet.PivotTables("PivotTable4").PivotFields("Traders Name").PivotFilters _
.Add Type:=xlCaptionDoesNotContain, Value1:="mac"
ActiveSheet.PivotTables("PivotTable4").PivotFields("Traders Name").PivotFilters _
.Add Type:=xlCaptionDoesNotContain, Value1:="chev"
I know I could add an extra column in my original data source which would take out the ones with info I don't need and then use that as a filter. However, I was wondering if there is a cleaner solution.
Instr
to make sure it doesn't contain either value, then setting the.Visible
property accordingly. – Rory Dec 2 '14 at 16:09