ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   End Double Sub (https://www.excelbanter.com/excel-programming/312937-end-double-sub.html)

Zurn[_21_]

End Double Sub
 

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

--
Zur
-----------------------------------------------------------------------
Zurn's Profile: http://www.excelforum.com/member.php...fo&userid=1464
View this thread: http://www.excelforum.com/showthread.php?threadid=26724


Rob van Gelder[_4_]

End Double Sub
 
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



--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Zurn" wrote in message
...

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

Zurn


--
Zurn
------------------------------------------------------------------------
Zurn's Profile:
http://www.excelforum.com/member.php...o&userid=14645
View this thread: http://www.excelforum.com/showthread...hreadid=267249





All times are GMT +1. The time now is 09:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com