chane what 'x' button on top right of the form does

  • Thread starter Thread starter sam
  • Start date Start date
S

sam

How can I code the 'x' button located on the top right of the form such that
it quits the application? or make it do something that I want.

Thanks in advance
 
paste behaind form:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

If CloseMode = 0 Then

'do something

MsgBox "You Pressed X"

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

Back
Top