View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default macro to call other macros

On May 3, 7:44*am, Colin Hayes wrote:
I need help to construct small routine which will call
a choice of macros.
I have in mind that if the user answers Yes to a popup
then one named macro would be run on the open workbook,
and if No were chosen then a different named macro would
be run on the open workbook.


What you ask for can be done with MsgBox. See the example below.
More generally, you might want to look the help page for InputBox.

Macros....

Sub doit()
Dim x As Long
x = MsgBox("Are you over 55?", vbYesNoCancel, "Your title")
If x = vbYes Then doit2 x _
Else If x = vbNo Then doit3 x
End Sub

Sub doit2(x As Long)
MsgBox "doit2 " & x
End Sub

Sub doit3(x As Long)
MsgBox "doit3 " & x
End Sub