View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default Help with Userforms

Add the macro below to the userform code module:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "You can't close the dialog like this!"
End If
End Sub

Here is where I got that code:
http://www.erlandsendata.no/english/...gspreventclose

Hope this helps,

Hutch

"Panagiotis Marantos" wrote:

Hello

just a quick question about userforms.

i want to disable the close button on the top right

how can i do that???