kann mir jemand dabei behilflich sein diesen Code so umzustellen das mehr als 10 Spalten funktionieren?
recht vielen dank für euer interesse.
liebe grüsse thomas
Dim lngIndex As Long
Dim lngCount As Long
Dim d As Long
ListBox1.Clear
ListBox1.ColumnCount = 10
TextBox1 = "1.10.2016"
TextBox2 = "30.10.2016"
'With ThisWorkbook.Worksheets(1)
lngCount = ThisWorkbook.Worksheets(1).UsedRange.Rows.Count
For lngIndex = 2 To lngCount
If Cells(lngIndex, 1).Value >= CDate(TextBox1) And Cells(lngIndex, 1).Value ListBox1.AddItem
ListBox1.List(ListBox1.ListCount - 1, 0) = Worksheets(1).Cells(lngIndex, 1).Value
ListBox1.List(ListBox1.ListCount - 1, 1) = Worksheets(1).Cells(lngIndex, 2).Value
ListBox1.List(ListBox1.ListCount - 1, 2) = Worksheets(1).Cells(lngIndex, 3).Value
ListBox1.List(ListBox1.ListCount - 1, 3) = Worksheets(1).Cells(lngIndex, 4).Value
ListBox1.List(ListBox1.ListCount - 1, 4) = Worksheets(1).Cells(lngIndex, 5).Value
ListBox1.List(ListBox1.ListCount - 1, 5) = Worksheets(1).Cells(lngIndex, 6).Value
ListBox1.List(ListBox1.ListCount - 1, 6) = Worksheets(1).Cells(lngIndex, 7).Value
ListBox1.List(ListBox1.ListCount - 1, 7) = Worksheets(1).Cells(lngIndex, 8).Value
ListBox1.List(ListBox1.ListCount - 1, 8) = Worksheets(1).Cells(lngIndex, 9).Value
ListBox1.List(ListBox1.ListCount - 1, 9) = CStr(lngIndex)
End If
Next
' End With