Display Pivot Items from Page Field

Mozzz

Board Regular
Joined
May 30, 2011
Messages
66
I have written code that asks the user to select the Week that they want displayed from the pagefields. I want to display the pagesfields to the user prior to asking them to select one.

Here is my code:

WeekNo = InputBox("Enter Week No ")
ActiveSheet.PivotTables(1).PageFields(1).CurrentPage = WeekNo

At this point the user has no idea what weeks are available. I either need to put a delay in so the user can select the Pagefield "Week" and see the available PivotItemsfrom the actual ActivePivotSheet or I need it to display them prior to the code written above.

Help
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
once the inputbox is up, the user cannot interact with Excel to check on somthing else, neither will any other code run. So you will need to display the weeks before putting up your inputbox.

There are two decent ways to do this:
1) create a calender or simplified week view in a sheet, and make that active before putting up the question. that way the user can look at the dates and enter the required week.

2) create your calendar/week view in a userform, where the user can also enter the required week. With userforms you have far more flexibility then with the very simple inputbox.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

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