ExcelEveryday1
New Member
- Joined
- Jan 7, 2016
- Messages
- 20
Good Morning,
I keep getting the error that is mentioned in the title when trying to hide a filter in my pivottable. I've googled possible solutions, but i cant figure out how to fix this...
I have code previous to this which enables the "A" filter on all my pivots, however I need to hide it in some cases. Excel wont let me hide it .
Relevant code is the following:
Thanks for your help!
I keep getting the error that is mentioned in the title when trying to hide a filter in my pivottable. I've googled possible solutions, but i cant figure out how to fix this...
I have code previous to this which enables the "A" filter on all my pivots, however I need to hide it in some cases. Excel wont let me hide it .
Relevant code is the following:
Code:
For x = 4 To 5
Sheets("page " & x).Activate
ActiveSheet.PivotTables("PivotPage" & x).PivotFields("Umbrella").Orientation = _
xlHidden
With ActiveSheet.PivotTables("PivotPage" & x).PivotFields("Umbrella")
.Orientation = xlPageField
.Position = 3
End With
ActiveSheet.PivotTables("PivotPage" & x).PivotFields("Umbrella").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivotPage" & x).PivotFields("Umbrella")
.PivotItems("A").Visible = False
.PivotItems("B").Visible = True
End With
next x
Thanks for your help!