AW: Listbox befüllen dauert nicht lange
06.09.2012 15:29:48
Rudi
Hallo,
Private Sub CommandButton1_Click()
Dim lRow As Long
Dim lastRow As Long
Dim objList As Object
Set objList = CreateObject("Scripting.dictionary")
UserForm1.ListBox1.Clear
UserForm1.ListBox1.ColumnCount = 10
UserForm1.ListBox1.ColumnWidths = "45;45;45;45;45;45;45;45;45;45"
'UserForm1.ListBox1.TextAlign = fmTextAlignLeft
With Sheets("Daten")
lastRow = .Range("A" & Sheets("Daten").Rows.Count).End(xlUp).Row
For lRow = 6 To lastRow
objList(lRow) = Array( _
.Cells(lRow, 1).Value, _
.Cells(lRow, 2).Value, _
.Cells(lRow, 3).Value, _
Format(.Cells(lRow, 4), "#,##0.00"), _
.Cells(lRow, 5).Value, _
Format(.Cells(lRow, 6), "#,##0.00"), _
Format(.Cells(lRow, 7), "#,##0.00"), _
.Cells(lRow, 8).Value, _
Format(.Cells(lRow, 9), "#,##0.00"), _
Format(.Cells(lRow, 10), "#,##0.00"))
Next
End With
ListBox1.List = WorksheetFunction.Transpose(WorksheetFunction.Transpose(objList.items))
End Sub
Gruß
Rudi