It's just from what i read in the initial requests i recognized an
issue that i was trying to solve a few years back and 'End' was
exactly what i was after back then and this sounded like the same as
with simple setups/routines that's all you need.
In my opinion, End is **never** the correct statement to ever use in active
code (for the very reasons Chip posted). Back in my volunteering days for
the compiled version of Visual Basic (the End statement is just as verboten
there as well), I explained it this way...
"Suffice it to say that the End statement stops your
program in the same way running into a brick wall
stops your car... immediately. You don't get a chance
to coast to a stop and turn your key to the off position,
open the door and exit the vehicle. The same thing
happens with the End statement... BOOM!, everything
stops dead in its tracks right then and there and the
program ends."
The following is from Remarks section of the Help Files for the End
Statement and it expands on this concept...
"When executed, the End statement resets all module-level
variables and all static local variables in all modules. To
preserve the value of these variables, use the Stop
statement instead. You can then resume execution while
preserving the value of those variables.
Note: The End statement stops code execution abruptly,
without invoking the Unload, QueryUnload, or Terminate
event, or any other Visual Basic code. Code you have
placed in the Unload, QueryUnload, and Terminate events
of forms and class modules is not executed. Objects
created from class modules are destroyed, files opened
using the Open statement are closed, and memory used
by your program is freed. Object references held by other
programs are invalidated.
The End statement provides a way to force your program
to halt. For normal termination of a Visual Basic program,
you should unload all forms. Your program closes as soon
as there are no other programs holding references to
objects created from your public class modules and no
code executing."
I note that this description references the compiled VB form events "Unload"
and "QueryUnload" (the Help Files are shared between the compiled VB and VBA
worlds and sometimes descriptions from one leak over into the other)...
Excel UserForms do not have these two events available, it only has the
QueryClose event in their place, but the warning about the End statement
applies to this event in the same way it applies the the compiled VB events.