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
 
Back
Top