Gruppe
Dialog
Problem
Wie kann ich eine Gruppe von UserForm-ListBoxes in einer Schleife ansprechen und beim Aufruf der UserForm mit Werten füllen?
ClassModule: frmListCollection
Private Sub cmdWeiter_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim col As New Collection
Dim iList As Integer, iItem As Integer
col.Add lstEins
col.Add lstZwei
col.Add lstDrei
col.Add lstVier
For iList = 1 To 4
For iItem = 1 To 10
col(iList).AddItem "Liste " & _
iList & " - Zeile " & iItem
Next iItem
col(iList).ListIndex = 0
Next iList
End Sub
StandardModule: basMain
Sub CallForm()
frmListCollection.Show
End Sub