Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default USERFORM X BUTTON

Hi all,

I am wondering what code do I need to stop the userform closing when the X
button is clicked?

Thanks in advance

Greg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default USERFORM X BUTTON



Something like this:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
End If
End Sub

--
Regards,
Tom Ogilvy


--
Regards,
Tom Ogilvy


"Greg B" wrote:

Hi all,

I am wondering what code do I need to stop the userform closing when the X
button is clicked?

Thanks in advance

Greg



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default USERFORM X BUTTON

Thank you for your answer

Greg

"Tom Ogilvy" wrote in message
...


Something like this:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
End If
End Sub

--
Regards,
Tom Ogilvy


--
Regards,
Tom Ogilvy


"Greg B" wrote:

Hi all,

I am wondering what code do I need to stop the userform closing when the
X
button is clicked?

Thanks in advance

Greg





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
OK Button in UserForm Jack_Feeman Excel Programming 3 October 19th 06 12:43 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Userform button Greg B[_5_] Excel Programming 2 May 18th 05 11:28 AM
The userform X button Esben[_6_] Excel Programming 2 June 3rd 04 03:11 PM
UserForm Button Help meflorence Excel Programming 2 March 2nd 04 05:35 PM


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

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

About Us

"It's about Microsoft Excel"