listbox geht combobox nicht
30.12.2003 14:54:48
ray
ich habe das Problem, da das was mit ListBox geht nicht so mit ComboBox geht.
Private Sub UserForm_Initialize()
Dim lR2%
lR2 = Worksheets("kreditorenliste").Cells(Rows.Count, 1).End(xlUp).Row
ListBox4.RowSource = "kreditorenliste!a1:b" & lR2
ListBox4.ListIndex = 0
Dim lR3%
lR3 = Worksheets("mitarbeiterliste").Cells(Rows.Count, 1).End(xlUp).Row
ComboBox1.RowSource = "mitarbeiterliste!a1:b" & lR3
ComboBox1.ListIndex = 0
End Sub
Ergebnis Beide boxen werden richtig angezeigt und ich kann auswählen.
Private Sub CommandButton1_Click()
Dim iii%
For iii = 0 To ListBox4.ListCount - 1
If ListBox4.Selected(iii) = True Then
MsgBox "Kredi " & ListBox4.List(iii, 0) & _
" ist ein " & ListBox4.List(iii, 1)
Worksheets("datenOutput").Range("q2").Value = ListBox4.List(iii, 0)
End If
Next iii
Dim iiii%
For iiii = 0 To ComboBox1.ListCount - 1
If ComboBox1.Selected(iiii) = True Then
MsgBox "MA " & ComboBox1.List(iiii, 0) & _
" ist ein " & ComboBox1.List(iiii, 1)
Worksheets("datenOutput").Range("p2").Value = ComboBox1.List(iiii, 0)
End If
Next iiii
Bekomme den Fehler das er bei combobox "Selected" nicht will.
Ziel ist die Ausgabe des angezeigten Wertes aus der ComboBox in Range("p2")
Weiß jemand rat? Danke und guten Rutsch.