Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Closing Userform

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Closing Userform

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" wrote in message
...
| 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
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
Closing UserForm Keri Excel Programming 3 October 25th 05 07:31 PM
closing userform automatically Jim Brass Excel Programming 1 September 5th 05 03:39 PM
closing a userform mangesh_yadav[_50_] Excel Programming 5 August 31st 04 02:26 PM
Vba - automaticaly closing userform ajliaks[_30_] Excel Programming 1 August 22nd 04 09:53 AM
Help with closing a UserForm Ron de Bruin Excel Programming 0 August 8th 03 01:52 PM


All times are GMT +1. The time now is 02:15 AM.

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"