Hide all items in Pivot Field except specific items

  • Thread starter Thread starter VAMS
  • Start date Start date
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.
 
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
 
Back
Top