View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default 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.