Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Record Macro to Create Pivot Table Ken Excel Discussion (Misc queries) 1 April 25th 07 09:42 PM
Can I run a macro to create a pivot table? Eqa Excel Discussion (Misc queries) 2 April 8th 07 06:16 AM
Assign a macro to create a pivot table acsugguiyao Excel Programming 2 June 23rd 05 03:04 AM
Error when runing macro to create pivot table Bruno[_3_] Excel Programming 0 August 3rd 04 06:47 PM
Macro to create pivot table/ chart Saint Excel Programming 2 July 6th 04 08:29 PM


All times are GMT +1. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"