ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   select macro within combo box or list box to (https://www.excelbanter.com/excel-discussion-misc-queries/192352-select-macro-within-combo-box-list-box.html)

Karin

select macro within combo box or list box to
 
I have created 3 macros that generate 3 separate charts. I would like to be
able to select any 1 of the 3 macros (charts) from a drop down list and have
it display on my chart_output worksheet.
Thank you.

Héctor Miguel

select macro within combo box or list box to
 
hi, Karin !

I have created 3 macros that generate 3 separate charts.
I would like to be able to select any 1 of the 3 macros (charts) from a drop down list
and have it display on my chart_output worksheet...


use a cell with data validation (say, A1) and a direct entry list with your macro_names
(i.e.): Macro1,Macro2,Macro3

then, copy/paste the following lines into "that" worksheet code module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" And Target < "" Then Application.Run Target.Text
End Sub

use data validatin drop-down list to choose your macro and...

if any doubts (or further information)... would you please comment ?
hth,
hector.



Karin

select macro within combo box or list box to
 
Thank you. I think I got the hang of it, now.

"Héctor Miguel" wrote:

hi, Karin !

I have created 3 macros that generate 3 separate charts.
I would like to be able to select any 1 of the 3 macros (charts) from a drop down list
and have it display on my chart_output worksheet...


use a cell with data validation (say, A1) and a direct entry list with your macro_names
(i.e.): Macro1,Macro2,Macro3

then, copy/paste the following lines into "that" worksheet code module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" And Target < "" Then Application.Run Target.Text
End Sub

use data validatin drop-down list to choose your macro and...

if any doubts (or further information)... would you please comment ?
hth,
hector.





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

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