select macro within combo box or list box to

  • Thread starter Thread starter Karin
  • Start date Start date
K

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.
Thank you.
 
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.
 
Thank you. I think I got the hang of it, now.

Héctor Miguel said:
hi, Karin !


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.
 
Back
Top