Stop a procedure call if..

mantis_sg

Board Regular
Joined
Nov 16, 2005
Messages
126
Hi is there a way to end all procedures or to skip/stop a procedure from running if an if statement is satisfied within another procedure... wow, not sure if I understand this...

was thinking of setting a global boolean and setting it to true in the if loop

but how would I code this and declare the variable, and how would I call it from within my main procedure? thanks.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
yeah, it's a little more complicated than that...

a button on a form does something like this....

Call a

If boolean = 1 then skip sub b
End if

Call b

End Sub

-----------------------------------------------------

Sub a

if something = true then
boolean = 1
Exis sub

End if

End Sub

--------------------------------------

Sub b

blah blah blah

End Sub
 
Upvote 0
Need to change your logic. There is no code for "skip" - only various ways to select something to *do*. 'If' is one ..

The basic form is :-
Code:
If MyBoolean <> 1 Then
    b
Else       ' can be omitted
    ' do something else
End If
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top