Mackro

N

Nyheder

Hey, is it possible to start a Macro from within another Macro.

How is it done.

Thanks in advance
 
J

Jim Cone

Enter the name (nothing else) of the second macro on its own line.


Hey, is it possible to start a Macro from within another Macro.

How is it done.

Thanks in advance
 
D

Dave Peterson

I like to use the Call keyword:

Sub Mac1()
Call Mac2
End Sub

Sub Mac2
msgbox "I'm in mac2"
End sub
 
D

Dave Peterson

And I like specifying the parms by name:

Call MyWarningSubroutine("Pay!", 9, "Yo!")
becomes:
Call MyWarningSubroutine(Msg:="Pay!", WarningNo:=9, Caption:="Yo!")

Then when (not if!) I copy that line of code, I don't have to remember what
order those passed values have to be.
 

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