Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Value Pivot Table Filter

Status
Not open for further replies.

HairyHippy

Programmer
Aug 5, 2004
53
GB
Hi

I currently have the following code:

Code:
Sheets("New New Deals").PivotTables("PivotTable2").PivotFields("EMEA Mkts").PivotFilters.Add _
        Type:=xlCaptionEquals, Value1:="BENELUX"

But I need to select 2 values but the following won't work:
Code:
Sheets("New New Deals").PivotTables("PivotTable2").PivotFields("EMEA Mkts").PivotFilters.Add _
        Type:=xlCaptionEquals, Value1:="BENELUX", Value2:="Nordics"

I'd rather use something similar to the above as it seems to run quicker than using the following code:
Code:
    With ActiveSheet.PivotTables("PivotTable2").PivotFields("EMEA Mkts")
        .PivotItems("BeneLux").Visible = False
        .PivotItems("Other SSA").Visible = False
        .PivotItems("South Africa").Visible = False
        .PivotItems("MENA").Visible = False
        .PivotItems("Mediterranean").Visible = False
End With

Any suggestions on how to achieve this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top