Automate Pivot Table to only 1 Item

S

Steve

I am trying to use the following code to clear all values in a Pivot table
except when it is "Need". However I do not know what may be entered into the
originating "Approval" field as several others use this spreadsheet. The
results appear in a ListBox and I only want "Need". in the below example
"David" may or may not be in the choices of the dropdown. I would like to
automate. Any help much appreciated.

With
Worksheets("Pivots").PivotTables("PivotTable3").PivotFields("Approval")
.PivotItems("David").Visible = False
.PivotItems("Dean").Visible = False
.PivotItems("Fred").Visible = False
.PivotItems("FG").Visible = False
.PivotItems("Need").Visible = True
End With
 

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