There are several approaches you could use
1.
2.Code:'Assumes you have a control array of listboxes eg list1(0) 'list1(1) and list1(2) Dim i as integer For i = 0 to 2 list1(i).addItem "Item in listbox " & Trim$(Str$(i)) Next
I haven't actually tested the second example and i have a feeling that you might need a set statement in there somewhere but give it a go anywayCode:'Passes the name of each list box to a sub that fills it fillListBox list1 fillListBox list2 fillListBox list3 Private Sub fillListBox(name as listbox) name.addItem "Item 1" name.addItem "Item 2" End Sub




Reply With Quote