Reputation: 4976
I have a Procedure which calls a module. Something like this:
Procedure:
Sub Procedure()
Module1.SubProcedure()
If Global.Variable = "A" Then
...
End If
End Sub
Module1:
Sub SubProcedure()
If x then
Exit Sub
ElseIf y then
End
End If
End Sub
Using 'End' resets the Global.Variable. Is there any alternative to 'End' Which would stop the execution of Procedure() and preserve the value of Global.Variable?
Upvotes: 1
Views: 1918
Reputation: 3888
You can use a Function instead of using a subprocedure and then return a boolean like this :
Function SubProcedure() as Boolean
If x then
SubProcedure = false
ElseIf y then
SubProcedure = true
End If
End Function
and add these line to the procedure code :
if module1.subprocedure then
End
end if
Upvotes: 3