thelostscott
Board Regular
- Joined
- May 7, 2010
- Messages
- 226
Hi all,
Is there another way to write some code that will allow me to "Unselect" every option in a Report Filter for a Pivot Table, then "Select" 3 options only?
I have tried something like this to no avail:
I have tried recording a macro but it generates a massive list of every option available =False, but this list will change every time I want to run this code and I don't it to keep pulling up errors just because some of the list has changed!
Thanks in advance
Is there another way to write some code that will allow me to "Unselect" every option in a Report Filter for a Pivot Table, then "Select" 3 options only?
I have tried something like this to no avail:
Code:
ActiveSheet.PivotTables("PivotTable1").PivotFields("Business").CurrentPage = "(All)"
ActiveSheet.PivotTables("PivotTable1").PivotFields("Business").EnableMultiplePageItems = True
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Business")
.PivotItems("(ALL)").Visible = False
.PivotItems("Business 1").Visible = True
.PivotItems("Business 2").Visible = True
.PivotItems("Business 3").Visible = True
End With
Thanks in advance