Gruppe
Dialog
Problem
Wie kann ich eine Mehrfachauswahl aus mehreren Listboxes in eine Tabelle eintragen?
ClassModule: frmListBoxes
Private Sub cmdEintragen_Click()
Dim cnt As Control
Dim iRow As Integer, iCol As Integer, iItem As Integer
iCol = 4
For Each cnt In Controls
iRow = 1
iCol = iCol + 1
If TypeName(cnt) = "ListBox" Then
For iItem = 0 To cnt.ListCount - 1
If cnt.Selected(iItem) Then
Cells(iRow, iCol) = cnt.List(iItem)
iRow = iRow + 1
End If
Next iItem
End If
Next cnt
End Sub
Private Sub cmdWeiter_Click()
Unload Me
End Sub
StandardModule: basMain
Sub CallForm()
frmListBoxes.Show
End Sub