Controlling Pivot Function from Form Combo Box

JamieLight

New Member
Joined
Jan 27, 2005
Messages
3
I am looking to control a pivot table option from a drop down menu on another worksheet. I have one page field on the pivot table which is 'Week01' to 'Week52' which controls all the options in the main doy of the pivot table. I have set up a drop down menu on another worksheet, which contains the list of weeks 01 to 52, but I cannot control the pivot field....

A friend has provided me with this code...



Public Sub sb_ChangePvt(strWeek As String)

' to use this function use the following code on the update of a cell
' or dropdown box
' call sb_ChangePvt("Week1") will change the pivot to week 1

Sheets("Pivot>>>>").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Week No").CurrentPage = strWeek

End Sub

I cant seem to get this to work, any ideas?

Thanks
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,148,526
Messages
5,747,216
Members
424,069
Latest member
kamkwok1hh

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