ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automate Pivot Table to only 1 Item (https://www.excelbanter.com/excel-discussion-misc-queries/159640-automate-pivot-table-only-1-item.html)

Steve

Automate Pivot Table to only 1 Item
 
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").Pi votFields("Approval")
.PivotItems("David").Visible = False
.PivotItems("Dean").Visible = False
.PivotItems("Fred").Visible = False
.PivotItems("FG").Visible = False
.PivotItems("Need").Visible = True
End With


All times are GMT +1. The time now is 01:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com