muhleebbin
Active Member
- Joined
- Sep 30, 2017
- Messages
- 252
- Office Version
- 365
- 2019
- 2016
- 2013
- 2010
- Platform
- Windows
- MacOS
- Mobile
- Web
Hi,
I have the following code, however "Yes" as a pivotitem may not always be visible. Is there a way to make this code work even if there isn't an instance of "Yes"? "No" isn't always used as well. Once you read the titles, you'll understand why
Thanks in advance for your help!
I have the following code, however "Yes" as a pivotitem may not always be visible. Is there a way to make this code work even if there isn't an instance of "Yes"? "No" isn't always used as well. Once you read the titles, you'll understand why
VBA Code:
With Worksheets("Pivot").PivotTables("PivotTable1").PivotFields("Active Covid Case")
.PivotItems("Yes").Visible = True
.PivotItems("No").Visible = False
.PivotItems("(blank)").Visible = False
End With
Thanks in advance for your help!