1

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
1
  • It is recommended to indicate the version of Excel you are using by selecting the correct flag. While you do that, please compare how Pivot features change/improved/discarded from 2003 to 2015... Check this as well. Commented Feb 24, 2015 at 7:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.