Thanks for that I have the exit and save button just didn't want the
opporunity for the person to lose their work from a little error. I have
all other userforms go back to the main sheet if the X button is pressed.
Thanks again
Greg
"dominicb" wrote in
message ...
Good afternoon Greg B
This is how to do it:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
Cancel = True
End Sub
Just don't forget to set up a close button, and if you do, don't forget
that you can crash out of a macro using ctrl + Break.
HTH
DominicB
--
dominicb
------------------------------------------------------------------------
dominicb's Profile:
http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=468606