#1   Report Post  
Greg B
 
Posts: n/a
Default

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Button anomalies RWN Excel Discussion (Misc queries) 5 May 4th 05 05:09 AM
2 part question - macro / command button John Excel Discussion (Misc queries) 3 April 16th 05 09:00 PM
Command Button VBA code Dave Peterson Excel Discussion (Misc queries) 2 January 25th 05 11:28 PM
Macro to simply bring up the Find dialogue box?? marika1981 Excel Discussion (Misc queries) 14 January 14th 05 10:47 PM
How do I setup a spin button in excel Andy K Excel Discussion (Misc queries) 1 November 26th 04 09:08 PM


All times are GMT +1. The time now is 09:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"