Using a cell integer to select a macro
Have one macro with a case statement
Sub Selectmacro()
Select Case Range("A1").Value
Case 1 : Call macroA
Case 2:: Call macroB
'etc.
Case Else: Msgbox "Invalid Value"
End Select
End Sub
--
HTH
Bob Phillips
wrote in message
ups.com...
I would like to have a user enter an integer between 1 and 6 into a
cell, and then have one of six macros execute automatically depending
on what integer was entered. (As an alternative, I could use a button
to start the macro after the integer entered by telling the user to hit
the button when done). I also hope to display an error message if an
unacceptable integer is entered. I can probably figure this out if I
keep at it long enough, but help is sure appreciated.
Bob Q.
|