![]() |
create a macro for a combo box to change a pivot table
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. |
create a macro for a combo box to change a pivot table
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. -- Regards, Tom Ogilvy wrote in message ups.com... 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. |
All times are GMT +1. The time now is 10:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com