I have a sub "main" which calls sub "prepare" as well as other subroutines. I have an if statement in "prepare" that exits the sub if a condition is met. However, it only exits that specific subroutine and then goes on to execute all of the other subroutines in "main".
If oAltIDLocationDictionary.Exists(sAltID) Then
MsgBox "It appears that there are two duplicate ID's in your alternate ID list. Duplicate ID's cannot be processed, please consolidate the location information into a single ID or remove the duplicate ID from the Alt-ID list."
Exit Sub
End If
Is there a way to exit the "main" from the "prepare" sub it's calling so that when the condition is met in the "prepare" sub the "main" sub stops and no further code is executed?
End.Mainor whatever can behave differently. It's a good concept to get hold of and it seems you're at a stage where it may be learned and come in handy one day...Endis essentially a Big Red Button that nukes the entire runtime context (i.e. resets any global state back to defaults). I've never needed to useEndeven once - the proper answer is proper control flow, not a Big Red Button.