Thread: Reset userform?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
muddan madhu muddan madhu is offline
external usenet poster
 
Posts: 747
Default Reset userform?

try this

For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then ctl.Value = ""
Next ctl


On Jun 28, 1:26*pm, "Charlotte E" <@ wrote:
I have a userform which contains no less than 32 testboxes of information!

Depending on which button the user clicks, on the userform, the text boxes
will contain different information.

Is there a way to clear the contents of all the text boxes, thus not having
32 VBA lines, like...

Textbox_01.Caption = ""
Textbox_02.Caption = ""

Etc...

Maybe something like...

For Each Textbox In Me
* * .Caption = ""
Next

(Tried the above - didn't work)

And the same 'problem' with Checkboxes?
Is there a way to reset all checkboxes in a userform?

Thanks in advance...