Is this possible


Posted by Frank on December 22, 2001 5:12 PM

Hi

Is there a way to call another sub() and goto a label within that sub to start.

For example

call mysub c:

would go to mysub then c: then start compiling.

Just wondering.

Thanks



Posted by Ivan F Moala on December 22, 2001 8:37 PM

One way todo this is as follows;
Note: A bit of thought has to go into the
routine to get the structure/Flow you want
right. There are other ways but this should
get you going quickly.

Sub Original()
'some code

Call calling(2)

'some more code

End Sub

Sub calling(Where As Integer)
Select Case Where

Case 1
GoTo 1
Case 2
GoTo 2
Case 3
GoTo 3
End Select

1:
MsgBox Where

Exit Sub
2:
MsgBox Where

Exit Sub
3:
MsgBox Where

End Sub