Hide all items in Pivot Field except specific items

V

VAMS

Howdy:

My workbook contains about ten tabs, each with one or two pivot tables.
Each table has a field (called "SP") listing about 50 salespeople. The list
varies periodically based on the source data.

Thanks to this community, I have a macro to successfully select a single
name in each table.

However, now I need a way to deselect All items, then select only 4
particular salespeople in each table.

Ideas, please? BTW, I run Excel 2007, but have to save files in 97/2003.

Thank you.
 
P

paul.robinson

Hi
Make everything invisible then make the ones you want visible

e.g
Dim PI as PivotItem
With .PivotFields("MYFIELD")
For Each PI In .PivotItems
PI.Visible = False
Next PI
.PivotItems("Item1").Visible = True
.PivotItems("Item2").Visible = True
.PivotItems("Item3").Visible = True
.PivotItems("Item4").Visible = True
End With

regards
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top