USERFORM X BUTTON

G

Greg B

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
 
G

Guest

Something like this:

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

Greg B

Thank you for your answer

Greg

Tom Ogilvy said:
Something like this:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top