create a macro for a combo box to change a pivot table

C

cailotto

I've been trying to figure out how to write a macro that changes the
value of a pivot table page from a combo box on another worksheet.

The example I have been using is the following:

Month Division Product Revenue Expense Profit
January East Product1 200 150 50
January West Product2 300 200 100
January North Product1 400 150 250
January South Product1 600 300 300
February East Product1 300 100 200
February West Product1 200 150 50
February North Product2 800 450 350
February South Product2 500 300 200
March East Product2 400 200 200
March West Product2 500 200 300
March North Product1 600 300 300
March South Product1 700 600 100

The page is Division. So if I create a combo box that chooses
East,West, North or South, I want to be able to choose the selection
from the combo box on one worksheet, and then the value of the pivot
table is then changed to that selection in the page.

Any code you can share on this example or an example that you created
would be greatly appreciated.
 
T

Tom Ogilvy

Turn on the macro recorder.

Change the page field manually

Turn off the macro recorder.

Generalize the code to work with the non - active page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top