Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Loop through userform
I have a userform with 7 ListBoxes
6 listboxes are populated by the selection made from ListBox1(some ListBoxes do not get populated all the time) How can I clear(reset) ListBoxes 2 to 7, because some selections will populate all the list boxes and some will only populate 1 or 2 listboxes, if a selection is made that populates all the listboxes, then another is made that only populates 1 listbox, the other listboxes are still populated because of not being cleared(reset) Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Loop through userform
ListBox'es have a Clear method which will remove the items in them. For
example, ListBox2.Clear should remove all the items in ListBox2. Rick "Paul Morgan" wrote in message ... I have a userform with 7 ListBoxes 6 listboxes are populated by the selection made from ListBox1(some ListBoxes do not get populated all the time) How can I clear(reset) ListBoxes 2 to 7, because some selections will populate all the list boxes and some will only populate 1 or 2 listboxes, if a selection is made that populates all the listboxes, then another is made that only populates 1 listbox, the other listboxes are still populated because of not being cleared(reset) Thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Loop through userform
Thanks or the reply,
That is the logical way to do it, but I am getting an unspecified error, I have used this Private Sub CommandButton8_Click() ListBox2.Clear ListBox3.Clear ListBox4.Clear ListBox5.Clear ListBox6.Clear ListBox7.Clear End Sub and this Sub ClearListBox() 'On Error Resume Next With UserForm1 ..ListBox2.Clear ..ListBox3.Clear ..ListBox4.Clear ..ListBox5.Clear ..ListBox6.Clear ..ListBox7.Clear End With both codes result in Unspecified errors If I use the error code then nothing happens at all.... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
For Each Loop | Excel Discussion (Misc queries) | |||
How to loop | Excel Discussion (Misc queries) | |||
if & Loop | Excel Discussion (Misc queries) | |||
Do Loop | Excel Discussion (Misc queries) | |||
Next w/o For If/Then Loop | Excel Discussion (Misc queries) |