I have a button in my excel workbook that launches nine macros/routines. The macros run one after the other and are dependent on the data generated by one or more of the previous. Of course when I started i only ran three or so macros and the whole thing crept/grew to where I am now. Problem I have is that I want to exit out of the routines if a error condition is found (I have a variable, error count, and if this equalls one or more the condition is met). So say following the execution of macro #3 I run my error check and If if finds an error it will bail on the remaining macros.
Alternately i can embed my macro into macro #3 and do the same bailing out.
Still another option is to merge all the macros into one , embed the error check code, and bail out if an error is found. Bottom line is I don't know how to do this, nor how best to do this.
To do that conditionally, test for the condition using IF THEN, then have Exit Sub as the THEN part.