ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combo Box (https://www.excelbanter.com/excel-programming/341447-combo-box.html)

tony

Combo Box
 
I have the following code that is embedded on a page that updates a Pivot
Table bases on a "State" selection. Is there a way to code a second ComboBox
on the same page to execute the "Private Sub ComboBox01_Change()"
programming. For example if Combox02_Change selects a metric such as "Sales
or Quotes" once the person picks Sales it would then also run through the
"Private Sub ComboBox01_Change()" procedure and pick the State again.

Private Sub ComboBox01_Change()
Dim sel_st
sel_st = Evaluate("state2").Value
Worksheets("Pivot1").PivotTables("PVTState").Pivot Fields("[DMA within
State]").CurrentPageName _
= sel_st
etc......

I guess what I am trying to do is find the code that is similar to the
Application.Run language that I use to run a macro within a macro.

Tom Ogilvy

Combo Box
 
If you change the declaration from Private to Public you can just do

Combobox01_change

in your code to execute this event.

--
Regards,
Tom Ogilvy


"Tony" wrote in message
...
I have the following code that is embedded on a page that updates a Pivot
Table bases on a "State" selection. Is there a way to code a second

ComboBox
on the same page to execute the "Private Sub ComboBox01_Change()"
programming. For example if Combox02_Change selects a metric such as

"Sales
or Quotes" once the person picks Sales it would then also run through the
"Private Sub ComboBox01_Change()" procedure and pick the State again.

Private Sub ComboBox01_Change()
Dim sel_st
sel_st = Evaluate("state2").Value
Worksheets("Pivot1").PivotTables("PVTState").Pivot Fields("[DMA within
State]").CurrentPageName _
= sel_st
etc......

I guess what I am trying to do is find the code that is similar to the
Application.Run language that I use to run a macro within a macro.





All times are GMT +1. The time now is 12:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com