I have a pivot table and I am trying to create multiple filters on them using Excel VBA.
Condition:
I want all the PCC level 3 hence PivotFields("PCC Level")=3 AND
I want the PivotFields("TowerLevel3")="Global Transition Services"
Issue :
PivotFields("TowerLevel3")="Global Transition Services" should populate when it is true for PCC Level 0,1,2,3.
Sub Macro2()
With ActiveSheet.PivotTables("PCC3ActionPlan").PivotFields("Project PCC Level")
.PivotItems("0").Visible = False
.PivotItems("1").Visible = False
.PivotItems("2").Visible = False
.PivotItems("3").Visible = True
End With
With ActiveSheet.PivotTables("PCC3ActionPlan").PivotFields("TowerLevel3")
.PivotItems("Applications Consulting").Visible = False
.PivotItems("Applications Development, Maintenance, & Support").Visible = _
False
.PivotItems("Applications Management and Support").Visible = False
.PivotItems("Applications Modernization").Visible = False
.PivotItems("Business Intelligence and Data Warehousing").Visible = False
.PivotItems("Business Process Services").Visible = False
.PivotItems("Cloud (non-Oracle)").Visible = False
.PivotItems("Cloud (Oracle-based)").Visible = False
.PivotItems("Consulting & Systems Integration").Visible = False
.PivotItems("Enterprise Application Services").Visible = False
.PivotItems("Enterprise Deployment Team").Visible = False
.PivotItems("Enterprise Managed Security").Visible = False
.PivotItems("Global Healthcare Consulting").Visible = False
.PivotItems("Global Transition Services").Visible = True
.PivotItems("Infrastructure & Technology Services").Visible = False
.PivotItems("Infrastructure Consulting Services").Visible = False
.PivotItems("Infrastructure Outsource Services").Visible = False
.PivotItems("Insite One (acquisition)").Visible = False
End With
End Sub