I use this code with a dropdown box on a spreadsheet to select months on a backend pivot table. it has worked great until I started to create a new dashboard - I just copied and pasted this code and changed the relevant fields: The name of the tab in the workbook with the data is "Summary", the pivot tables to change are "Message1" and "Message2", and the pivotfields being changed in both tables is the Month field... the error message is
"runtime error 1004: Application-defined or object-defined error"
"runtime error 1004: Application-defined or object-defined error"
Code:
Sub MessageMonthMacro()
Application.ScreenUpdating = False
'
' Internal dashboard month drop down box macro
'
Sheets("Summary").PivotTables("Message1").PivotFields("Month").CurrentPage = Range("selMonth").Text
Sheets("Summary").PivotTables("Message2").PivotFields("Month").CurrentPage = Range("selMonth").Text
Application.ScreenUpdating = True
End Sub