X button question

G

Greg B

I was wondering if I would be able to disble the "x" button only on the
userform called "main"?

If so how do I do it?

Thanks

Greg
 
D

dominicb

Good afternoon Greg B

This is how to do it:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode A
Integer)
Cancel = True
End Sub

Just don't forget to set up a close button, and if you do, don't forge
that you can crash out of a macro using ctrl + Break.

HTH

Dominic
 
G

Greg B

Thanks for that I have the exit and save button just didn't want the
opporunity for the person to lose their work from a little error. I have
all other userforms go back to the main sheet if the X button is pressed.

Thanks again

Greg
 

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