TheMadTree
New Member
- Joined
- Mar 23, 2015
- Messages
- 25
Good afternoon,
I'm trying to use a variable to select filter in a pivot. The code i'm working with is:
""
Workbooks("Banana - Copy.xlsx").Sheets("PIVOT").PivotTables("PivotTable1").PivotFields("Week").CurrentPage = "(All)"
With Workbooks("Banana - Copy.xlsx").Sheets("PIVOT").PivotTables("PivotTable1").PivotFields("Week")
.ClearAllFilters
.PivotItems(" & Weeknumber & ").Visible = True
End With
""
The code stops on "".PivotItems(" & Weeknumber & ").Visible = True""
Why doesn't this work?
Can anyone help me?
I'm trying to use a variable to select filter in a pivot. The code i'm working with is:
""
Workbooks("Banana - Copy.xlsx").Sheets("PIVOT").PivotTables("PivotTable1").PivotFields("Week").CurrentPage = "(All)"
With Workbooks("Banana - Copy.xlsx").Sheets("PIVOT").PivotTables("PivotTable1").PivotFields("Week")
.ClearAllFilters
.PivotItems(" & Weeknumber & ").Visible = True
End With
""
The code stops on "".PivotItems(" & Weeknumber & ").Visible = True""
Why doesn't this work?
Can anyone help me?