Hey, I'm working on a bunch of pivots using VBA. I need to isolate "Bermuda" in a list of countries and am looking for an easier way to isolate. The list is going to get a lot longer and removing fields individually definitely can't be a solution. Also with Visible=False process, after a bunch of them, I had to end and start the with again to continue. Anyone?? This can't be right. Thanks!
With ActiveSheet.PivotTables("BermudaCanada").PivotFields("Domicile Country")
.PivotItems("Australia").Visible = False
.PivotItems("Austria").Visible = False
.PivotItems("Belgium").Visible = False
.PivotItems("Canada").Visible = False
.PivotItems("Cayman Islands").Visible = False
.PivotItems("France").Visible = False
.PivotItems("Germany").Visible = False
.PivotItems("Hong Kong").Visible = False
.PivotItems("Indonesia").Visible = False
.PivotItems("Ireland").Visible = False
.PivotItems("Italy").Visible = False
.PivotItems("Korea").Visible = False
.PivotItems("Netherlands").Visible = False
.PivotItems("Singapore").Visible = False
End With
With ActiveSheet.PivotTables("BermudaCanada").PivotFields("Domicile Country")
.PivotItems("Switzerland").Visible = False
.PivotItems("UK").Visible = False
.PivotItems("USA").Visible = False
End With
With ActiveSheet.PivotTables("BermudaCanada").PivotFields("Domicile Country")
.PivotItems("Australia").Visible = False
.PivotItems("Austria").Visible = False
.PivotItems("Belgium").Visible = False
.PivotItems("Canada").Visible = False
.PivotItems("Cayman Islands").Visible = False
.PivotItems("France").Visible = False
.PivotItems("Germany").Visible = False
.PivotItems("Hong Kong").Visible = False
.PivotItems("Indonesia").Visible = False
.PivotItems("Ireland").Visible = False
.PivotItems("Italy").Visible = False
.PivotItems("Korea").Visible = False
.PivotItems("Netherlands").Visible = False
.PivotItems("Singapore").Visible = False
End With
With ActiveSheet.PivotTables("BermudaCanada").PivotFields("Domicile Country")
.PivotItems("Switzerland").Visible = False
.PivotItems("UK").Visible = False
.PivotItems("USA").Visible = False
End With