Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
For Each Loop jbjtc Excel Discussion (Misc queries) 8 September 20th 07 01:28 PM
How to loop saman110 via OfficeKB.com Excel Discussion (Misc queries) 4 July 25th 07 01:09 AM
if & Loop steven.holloway Excel Discussion (Misc queries) 5 July 20th 07 09:50 AM
Do Loop Noemi Excel Discussion (Misc queries) 0 December 8th 05 10:43 PM
Next w/o For If/Then Loop littlegreenmen1 Excel Discussion (Misc queries) 5 June 9th 05 05:28 PM


All times are GMT +1. The time now is 09:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"