Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

Dynamic VBA macro to hide all pivot table values

$
0
0

Looking for a dynamic and quick way to hide all pivot table values. As of now, I have the code below, but this only works as long as there aren't any new values (Example: if account "333" was added to the data, the script would break). Any suggestions?

Sub Hide_Accounts()
   With ActiveSheet.PivotTables("PivotTable2").PivotFields("Account")
       .PivotItems("000").Visible = False
       .PivotItems("111").Visible = False
       .PivotItems("222").Visible = False
       .PivotItems("(blank)").Visible = False
   End With
End Sub

Viewing all articles
Browse latest Browse all 88854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>