Whats wrong with this code?

juju

Board Regular
Joined
Mar 13, 2008
Messages
172
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"

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
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

juju

Board Regular
Joined
Mar 13, 2008
Messages
172
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"

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


Anyone? - I'd really appreciate some help with this .... thx!
 
Upvote 0

juju

Board Regular
Joined
Mar 13, 2008
Messages
172
Anyone? - I'd really appreciate some help with this .... thx!


I am working on a project which is due today and I cant figure this one out! I will appreciate any insight I can get .. thanks ..
 
Upvote 0

Forum statistics

Threads
1,191,204
Messages
5,985,261
Members
439,953
Latest member
suchitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top