I have been searching and can't find what I need...Perhaps the gurus can help.
I have a pivot table that has a BIG list of product codes. I am trying to use VBA to help me quickly filter my pivot table to hide all product codes EXCEPT the 5 I want to see. Scrolling through the drop-down list to select the 5 out of 1,000 codes is a royal pain.
Here is a sample of the code (kind-of) I am trying to create:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Product Code")
.PivotItems("All").Visible = False ' All is not in the list. I need to know if there is a way to have the code de-select all codes
.PivotItems("PROD1").Visible = True
.PivotItems("PROD2").Visible = True
.PivotItems("PROD3").Visible = True
.PivotItems("PROD4").Visible = True
.PivotItems("PROD5").Visible = True
End with
I'd appreciate any help...
I have a pivot table that has a BIG list of product codes. I am trying to use VBA to help me quickly filter my pivot table to hide all product codes EXCEPT the 5 I want to see. Scrolling through the drop-down list to select the 5 out of 1,000 codes is a royal pain.
Here is a sample of the code (kind-of) I am trying to create:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Product Code")
.PivotItems("All").Visible = False ' All is not in the list. I need to know if there is a way to have the code de-select all codes
.PivotItems("PROD1").Visible = True
.PivotItems("PROD2").Visible = True
.PivotItems("PROD3").Visible = True
.PivotItems("PROD4").Visible = True
.PivotItems("PROD5").Visible = True
End with
I'd appreciate any help...