PDA

View Full Version : Selection.OnAction = "macro1"



uktous
07-01-2012, 09:16 AM
Hi,

Selection.OnAction = "macro1"

I know that the above code can run macro1 once we click the shape.

Is it possible to run more than one macro?

Thanks

Bob Phillips
07-01-2012, 10:15 AM
Yeah, in Macro1 call the other macro at the appropriate point.

Paul_Hossler
07-01-2012, 05:51 PM
Sub Macro1
Macro2
Macro3
Macro4
End Sub


Paul

Aussiebear
07-02-2012, 02:30 AM
Hmmmm... Shouldn't that be

Sub Macro 1()
Call Macro 2
Call Macro 3
Call Macro 4

Paul_Hossler
07-02-2012, 04:52 AM
I hadn't intended that the '2' and '3' and '4' be passed parameters

Since the OP used 'Macro1', I just continued with parameter-less subs.


Option Explicit
Sub macro1()
Macro2
Macro3
Macro4
End Sub
Sub Macro2()
MsgBox "Hello from Macro2"
End Sub
Sub Macro3()
MsgBox "Hello from Macro3"
End Sub
Sub Macro4()
MsgBox "Hello from Macro4"
End Sub



BTW, the 'space' in


Sub Macro 1()


must have been a typo or a tags format problem, since you can't define a Sub name with a space in it


Paul

Aussiebear
07-02-2012, 03:54 PM
Yes it was, thanks Paul