Joe Was
MrExcel MVP
- Joined
- Feb 19, 2002
- Messages
- 7,539
I have some complex code that calls a macro then runs other code. The called macro has GoTo tags and runs correctly on its own. If I call that macro in another that has additional code in it, the "End" used to stop the other Tags in the called macro from also running, stops the new code from running after the called macro.
The code setup is like this example:
Sub myTest()
If [A1].Value = "1" Then
GoTo myRight
Else
GoTo myEnd
End If
myRight:
MsgBox "Worked"
End '<== This is the problem!
myEnd:
MsgBox "Not Right"
End Sub
Sub myRun()
myTest
MsgBox "Ran This Too!"
End Sub
What can I use inplace of "End" to stop both: myRight and myEnd from both running and run the additional code in the calling Sub myRun? Thanks Joe Was
This message was edited by Joe Was on 2002-10-26 11:38
The code setup is like this example:
Sub myTest()
If [A1].Value = "1" Then
GoTo myRight
Else
GoTo myEnd
End If
myRight:
MsgBox "Worked"
End '<== This is the problem!
myEnd:
MsgBox "Not Right"
End Sub
Sub myRun()
myTest
MsgBox "Ran This Too!"
End Sub
What can I use inplace of "End" to stop both: myRight and myEnd from both running and run the additional code in the calling Sub myRun? Thanks Joe Was
This message was edited by Joe Was on 2002-10-26 11:38