View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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