PC Review


Reply
Thread Tools Rate Thread

Closing Userform

 
 
=?Utf-8?B?RGF2ZSBN?=
Guest
Posts: n/a
 
      15th Aug 2007
Hello,

I am looking to run a macro whenever the userform is closed, whether by a
cancel button created by me or by clicking the red 'x'.

Thanks

Dave
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      15th Aug 2007
That's what the UserForm_QueryClose and UserForm_Terminate event handlers
are for.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
''Allows cancelling close by setting Cancel = True
End Sub

Private Sub UserForm_Terminate()
''Runs after userform is terminated
End Sub

--
Jim
"Dave M" <(E-Mail Removed)> wrote in message
news:A1B65277-ED74-44E9-ADB1-(E-Mail Removed)...
| Hello,
|
| I am looking to run a macro whenever the userform is closed, whether by a
| cancel button created by me or by clicking the red 'x'.
|
| Thanks
|
| Dave


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent closing userform Gert-Jan Microsoft Excel Programming 1 8th Oct 2006 03:59 PM
Prevent closing userform Gert-Jan Microsoft Excel Programming 0 8th Oct 2006 03:48 PM
Closing UserForm =?Utf-8?B?S2VyaQ==?= Microsoft Excel Programming 3 25th Oct 2005 07:31 PM
closing a userform mangesh_yadav Microsoft Excel Programming 5 31st Aug 2004 02:26 PM
Re: Help with closing a UserForm Ron de Bruin Microsoft Excel Programming 0 8th Aug 2003 01:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:49 AM.