Private Sub UserForm_Initialize()
Dim lngZeile As Long
Dim lngZeileMax As Long
Dim lngz As Long
Dim arrList As Variant
With ThisWorkbook.Worksheets("Quelldaten")
Me.ListBox1.ColumnCount = 13
Me.ListBox1.ColumnWidths = "75;55;105;125;60;65;95;95;65;55;65;75;75"
lngZeileMax = .Range("H" & .Rows.Count).End(xlUp).Row
Me.ComboBox1.RowSource = .Name & "!H3:H" & lngZeileMax
lngZeileMax = .Range("I" & .Rows.Count).End(xlUp).Row
Me.ComboBox2.RowSource = .Name & "!I3:I" & lngZeileMax
lngZeileMax = .Range("K" & .Rows.Count).End(xlUp).Row
Me.ComboBox4.RowSource = .Name & "!K3:K" & lngZeileMax
lngZeileMax = .Range("P" & .Rows.Count).End(xlUp).Row
Me.ComboBox5.RowSource = .Name & "!P3:P" & lngZeileMax
lngZeileMax = .Range("O" & .Rows.Count).End(xlUp).Row
Me.ComboBox6.RowSource = .Name & "!O3:O" & lngZeileMax
lngZeileMax = .Range("Q" & .Rows.Count).End(xlUp).Row
Me.ComboBox7.RowSource = .Name & "!Q3:Q" & lngZeileMax
lngZeileMax = .Range("D" & .Rows.Count).End(xlUp).Row
Me.ComboBox8.RowSource = .Name & "!D3:D" & lngZeileMax
End With
With ThisWorkbook.Worksheets("Ereignisse")
lngZeileMax = .Range("B" & .Rows.Count).End(xlUp).Row
arrList = .Range(.Cells(3, 2), .Cells(lngZeileMax, 14)) '12 = Spalte L
Me.ListBox1.List = arrList
Erase arrList
Me.ListBox1.ListIndex = 1
End With
With Me.ComboBox3
.AddItem "Nein"
.AddItem "Ja"
End With
With Me.ComboBox9
.AddItem "offen"
.AddItem "erledigt"
End With
End Sub
In der zweiten Spalte befinden sich Uhrzeiten, welche nicht im richtigen Format übernommen werden. Kann mir da jemand helfen?Im Weiteren würde ich gerne noch die Kopfzeile einbauen...
Gruss Longo