I have a userform that contains 2 comboboxes and 6 textboxes. I'd like the textboxes to clear everytime the combobox #2 selection is changed by a user. any ideas on how to do this?
I have a userform that contains 2 comboboxes and 6 textboxes. I'd like the textboxes to clear everytime the combobox #2 selection is changed by a user. any ideas on how to do this?
[vba]
Private Sub ComboBox2_Change()
With Me
.TextBox1.Text = ""
.TextBox1.Text = ""
.TextBox2.Text = ""
.TextBox3.Text = ""
.TextBox4.Text = ""
.TextBox5.Text = ""
.TextBox6.Text = ""
End With
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
thanks! that works perfect. sorry if it was a common sense answer, im a newbie!
We all were once
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
FYI, you could also use a loop like this if you have a lot of textboxes and you want them all cleared:
[VBA] Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is MSForms.TextBox Then ctl.Text = ""
Next ctl
[/VBA]
Regards,
Rory
Microsoft MVP - Excel