tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,913
- Office Version
- 365
- 2019
- Platform
- Windows
The code below works perfectly fine:
In Module1:
However, if say in Module2 I also have two Subs, a and b, then I would like to refer to those Subs, instead of the ones in Module1.
But this does not work:
How can specify the Module?
Thanks
In Module1:
Code:
Sub a
Msgbox "a"
Sheet1.Shapes("MyShape").OnAction = "b"
End Sub
Sub b
Msgbox "b"
Sheet1.Shapes("MyShape").OnAction = "a"
End Sub
However, if say in Module2 I also have two Subs, a and b, then I would like to refer to those Subs, instead of the ones in Module1.
But this does not work:
Code:
Sub a
Msgbox "a"
'either
Sheet1.Shapes("MyShape").OnAction = Module2."b"
'or
Sheet1.Shapes("MyShape").OnAction = Module2.b
'fails
End Sub
Sub b
Msgbox "b"
'either
Sheet1.Shapes("MyShape").OnAction = Module2."a"
'or
Sheet1.Shapes("MyShape").OnAction = Module2.a
'fails
End Sub
How can specify the Module?
Thanks
Last edited: