End Double Sub

  • Thread starter Thread starter Zurn
  • Start date Start date
Z

Zurn

Yes I know, but do you have a sollution for my problem? With the *En
Sub*, I end the sub I'm working with, *not the Sub that is referring t
this sub*. (see code a few messages above)

Zur
 
Turn the sub into a function and return a boolean (true or false).

The calling procedure exits depending on the value of the returned value.

eg.

Sub Proc()
If Func() = False Then
MsgBox "Arrgh"
Exit Sub
End If

MsgBox "Made it!"
End Sub

Function Func() As Boolean
If MsgBox("Click Me", vbOKCancel) = vbOK Then
Func = True
Else
Func = False
End If
End Function
 

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

Back
Top