There isn't built-in way to clear a user forms controls back to
their default state. You would have to loop through the Controls
collection and reset the controls, or do each one individually.
The following code will clear out the text boxes on a form. You
can adapt the code for other types of controls.
Private Sub CommandButton1_Click()
Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C
End Sub
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.