ich habe Probleme mit dem untenstehenden Code.
Bis zur ListCount 1,9 lädt er alles super in die ListBox1. Wobei hier schon das Problem besteht, dass ich die Spaltenbreite innerhalb der Listbox für die 1,9 nicht ändern kann.
Sobald ich versuche 1,10 zu definieren krieg ich eine Fehlermeldung, Laufzeitfehler 380, Eigenschaftswert ungültig.
WIe lös ich das Problem?
Private Sub UserForm_Initialize()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Daten")
Dim letzteZeile As Long
letzteZeile = ws.Cells(ws.Rows.Count, "A").End(xlUp).row
Dim i As Long
For i = letzteZeile To 10 Step -1
ListBox1.AddItem ws.Cells(i, "A").Value
ListBox1.List(ListBox1.ListCount - 1, 1) = Format(ws.Cells(i, "B").Value, "dd.mm.yyyy")
ListBox1.List(ListBox1.ListCount - 1, 2) = Format(ws.Cells(i, "C").Value, "hh:mm")
ListBox1.List(ListBox1.ListCount - 1, 3) = ws.Cells(i, "I").Value
ListBox1.List(ListBox1.ListCount - 1, 4) = ws.Cells(i, "G").Value
ListBox1.List(ListBox1.ListCount - 1, 5) = ws.Cells(i, "H").Value
ListBox1.List(ListBox1.ListCount - 1, 6) = ws.Cells(i, "E").Value
ListBox1.List(ListBox1.ListCount - 1, 7) = ws.Cells(i, "K").Value
ListBox1.List(ListBox1.ListCount - 1, 8) = ws.Cells(i, "O").Value
ListBox1.List(ListBox1.ListCount - 1, 9) = ws.Cells(i, "P").Value
ListBox1.List(ListBox1.ListCount - 1, 10) = ws.Cells(i, "Q").Value
Next i
With UF_Startseite.ListBox1
.ColumnCount = 11
.ColumnWidths = "29;56;32;190;140;25;55;36;30;30;150"
End With
End Sub
Vielen Dank schon mal im Voraus.
Beste Grüße