Exiting all functions/subs

E

Emilio

Hello,
I have a sub that call a fuction, in which I have an if statement that if is
true it does an Exit Function. My question is how can I have it to exit the
sub too, or exit all functions/subs.
thanks!!
 
O

Ofer

Return with the function True or False, and by the value returned you eill
knew if to exit the sub or not

Sub MySubName()
' call the function

If MyFunctionName = true then ' Its enough to write - If MyFunctionName
then
exit sub
End if

End Sub
========================
Function MyFunctionName()
If True then
MyFunctionName = true
Else
MyFunctionName = false
End If
End Function
=========================
 
Top