macro to call other macros

  • Thread starter Thread starter Colin Hayes
  • Start date Start date
C

Colin Hayes

Hi all

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.

Can some one help with this?

Grateful for any advice.
 
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
 
Back
Top