Trying to create macro to change multiple pivot table filters when a Drop Down box is changed excel 2010

LearningMacros

New Member
Joined
Jan 17, 2013
Messages
1
I think I'm almost there, just need to find a way to point the filter at the drop down box. My macro code appears below. The macro works when I use the commented out line which points to the value of cell e2. The problem is, I want it to point at my dropdown box instead. I think I just have the naming convention wrong. When I change the drop down box using the code below, I get Run-time error '424': Object required
Sub DropDown3_Change()
Dim UserChosenPlant As String


'UserChosenPlant = Range("e2").Value
UserChosenPlant = DropDown3.Value

ActiveSheet.PivotTables("PivotTable4").PivotFields("Branch Plant").CurrentPage _
= UserChosenPlant

ActiveSheet.PivotTables("PivotTable5").PivotFields("Branch Plant").CurrentPage _
= UserChosenPlant

ActiveSheet.PivotTables("PivotTable7").PivotFields("Branch Plant").CurrentPage _
= UserChosenPlant

ActiveSheet.PivotTables("PivotTable8").PivotFields("Branch Plant").CurrentPage _
= UserChosenPlant

End Sub​
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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
Back
Top