Subscribe for Weekly Tutorials
BONUS: subscribe now to download our Top Tutorials Ebook!
Reset All Values in a UserForm
Clear or reset all values in a UserForm so that they contain only the default original values.
This method will remove all input and selections made by the user.
Sections:
Reset UserForm
To do this, we simply close the form and then reopen it. This is the easiest way to completely reset the form and go back to the original values for each control.
Unload Me
UserForm1.Show
The first line removes the UserForm and the second line makes it reappear.
UserForm1 is the name of the form that you want to show. You get this from the (Name) section of the Properties window when you select the form.
You can use the above code however you like, but it is often attached to a button within the UserForm.
In this example, double-click the Reset Form button and place the code within the code section that appears for this button:
The name of the Reset Form button is CommandButton3.
Now, we have a button in the form that will reset everything back to the way the form was when it was originally opened.
Notes
When you use this method to clear/reset a form, you will see the window flicker; that is just the current form being closed and then re-opened again.
Make sure to download the attached file to get this example in Excel.