Put a commandbutton on your userform and write the below code on command button Click event.
Private Sub CommandButton1_Click()
Unload Me
End Sub
Then set cancel to true in its property. See image below(Click on the image to enlarge it)
Now when you run userform and press escape key on your keyboard, userfrom will be closed.
Is the post useful? Please post your comment and follow my blog:)
Is the post useful? Please post your comment and follow my blog:)



