I have 3 pivot tables and I'm filtering them by Prior day, Current Month, Current year.
The prior day and the Yearly filters work. I can't get the current month to work (highlighted in red below).
The error I'm getting says "Run-time error 1004. Application-defined or object-defined error"
The month is spelled out in the data I'm using. ex: "October".
Any ideas? I know it's probably something simple.
Thanks!
The prior day and the Yearly filters work. I can't get the current month to work (highlighted in red below).
The error I'm getting says "Run-time error 1004. Application-defined or object-defined error"
The month is spelled out in the data I'm using. ex: "October".
Any ideas? I know it's probably something simple.
Thanks!
Code:
ActiveSheet.PivotTables("PivotTable4").PivotFields("Date").ClearAllFilters
ActiveSheet.PivotTables("PivotTable4").PivotFields("Date").CurrentPage = (Date - 1)
ActiveSheet.PivotTables("PivotTable5").PivotFields("Month").ClearAllFilters
[COLOR=Red][B] ActiveSheet.PivotTables("PivotTable5").PivotFields("Month").CurrentPage = MonthName(Month(Date))[/B][/COLOR]
ActiveSheet.PivotTables("PivotTable6").PivotFields("Year").ClearAllFilters
ActiveSheet.PivotTables("PivotTable6").PivotFields("Year").CurrentPage = Year(Date)