ich habe in einer UserForm eine ComboBox mit Datum und möchte die richtigen Werte nach Datum in TextBoxen zuordnen . Für bestimmtes Datum gibt es aber mehrere Werte....das ist mein Problem, der Code listet alles der Reihenfolge auf, unabhängig von der Datumsauswahl in der ComboBox....
Datensatz in Tabelle 1
Spalte A, B, C
27.10.2017 144 B33
23.10.2017 145 B34
23.10.2017 146 B35
24.10.2017 147 B36
24.10.2017 148 B37
24.10.2017 149 B38
27.10.2017 150 B39
28.10.2017 151 B40
29.10.2017 152 B41
29.10.2017 153 B42
31.10.2017 154 B43
Mein Code:
'Darstellung in TextBoxen
Private Sub cboList_Change()
Dim i As Integer
cboList.Value = CDate(cboList.Value)
txtFlight.Text = Cells(cboList.ListIndex + 1, 2).Value
txtFlight2.Text = Cells(cboList.ListIndex + 2, 2).Value
txtFlight3.Text = Cells(cboList.ListIndex + 3, 2).Value
End Sub
'ComBoBox in UserForm
Private Sub UserForm_Initialize()
Dim intCounter As Integer
Dim einm As Object, i As Long
For intCounter = 1 To 11
cboList.AddItem Cells(1, intCounter)
Next intCounter
cboList.ListIndex = 0
'wert in cboList nur einmal
Set einm = CreateObject("Scripting.Dictionary")
With Sheets("tabelle1")
For i = 2 To .Cells(.Rows.Count, 1).End(xlUp).Row
einm(.Cells(i, 1).Text) = 0
Next
End With
cboList.List = Application.Transpose(einm.Keys)
End Sub
Kann mir jemand dazu einen Tippp geben,
vielen Dank, Lea