End routine by clicking 'X' on Userform
Click on the userform and select view code; from the dropdow box on the code
section select Userform, then from the events dropdow select Terminate
You will get the following:
Private Sub UserForm_Terminate()
End Sub
Type End in between the Sub and end Sub instructions
If this posting was helpful, please click on the Yes button.
Regards,
Michael Arch.
"Arnie" wrote:
Hello,
I have a routine which calls a Userform. On the userform someone can make a
choice. After that the routine continues.
But I want to stop the complete routine if someone clicks on the 'X' at the
right corner. How to?
Exit sub won't work this only stops the userform and the main routine still
continues.
Arnie
|