Use Combo Box value to determine macro used

R

Richhall

Hi

I have a combo box with different months in. The user will select a
month then select a button to determine what report to run. I have 5
buttons for each month, so rather than have 60 buttons, I want to
select the Month, and then the user chooses the button. I then want
the button to use the month to determine the macro it should run.

I've done it so that the combo box sends a number to a cell (i.e Dec =
12) and then I use VLookup to return the month again in a different
cell (i,.e B13). I then have a number of Macros, i,e JanMacroA, Jan
MacroB, JanMacroN, and repeated for FebMacroA, etc for all the months
and thought maybe I could use the text value and put this in each
macro. i,e Run "B13"MacroA. Alternatively, all the Macros are the
same for each month, and just reference sheets etc. So if I could
create 5 single macros for each of the buttons, and use the combobox
value within the macro this would be great. For example this is one of
the simple macros:

Sheets("Jan 08").Visible = True
Selection.AutoFilter Field:=2, Criteria1:="Night"

So I want the Jan 08 to be whatever is in "B13" 08??

Can anyone help please?

Cheers

Rich
 
R

Richhall

In addition, I have also used the B13 value to add into another field
and create the names I need:

i.e

B13 ComboBox Selection e.g. Jan
B14 08
B15 =B13&B14 e.g. Jan 08

So basically just need to know how to use this value as text in a
macro.

Cheers

Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top