I have a userform that is opened when a user clicks a button in a worksheet. After clicking the button, if the user inputs some data, then decides to close the form, the previously entered data remains in the form. How can (in code) I get rid of that data so it opens with the default every time the button is clicked?
Currently I just use
when the button is clicked and
when the user hits the cancel button within the form.
preguntado el 09 de marzo de 12 a las 16:03
You could catch the closing event and call unload inside like this
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Unload Me End Sub