How do I create a Reset Button on a form created in Excel

S

SadiesMom

I am using Excel 2003 and have set up a form for people to fill out on their
computers, print off and then send to the appropriate department.
I want to incorporate a RESET button for the user in case they make a
mistake filling it out.
I can't write a macro to undo because there are option buttons in the form
and they won't undo. I thought about having the file close and re-open, but
have been unsuccessful in being able to write a macro to do such a task.
I have no VBA experience. Anyone knowing of a good resourse from me to
learn VBA as well as an answer for the "reset" situation is greatly
appreciated.
 
S

Susan

if you have a userform_initialize routine that sets up the userform -
makes all the option button values false, clears the textboxes, etc.,
you can use that.

'--------------------------------------------------
Private Sub cmdReset_click()

Call userform_initialize

end sub
'----------------------------------------------------

otherwise you've got to do it inside the cmdReset sub.
something like:

'---------------------------------------------------
Private Sub cmdReset_click()

with Me
.optionbutton1.value = false
.optionbutton2.value = false
.optionbutton3.value = false
.textbox1.value = ""
.textbox2.value = ""
'etc whatever controls you've got
End With

End Sub
'-------------------------------------------------

hope that helps get you started!
:)
susan
 

Ask a Question

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.

Ask a Question

Top