Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Working - thanks :-)
muddan madhu wrote: 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... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA - UserForm Reset Option | Excel Programming | |||
Reset userform | Excel Programming | |||
Userform loses its capabilities...reset??? | Excel Programming | |||
Userform loses its capabilities...reset??? | Excel Programming | |||
Userform Reset After Scrolling | Excel Programming |