.ListBox3.Column(10, i) = Cells(lng, 10).Value
14.10.2016 15:20:08
Robert
folgender Code befüllt eine Listbox mit Daten.
Sub Suchen_SupplierScoring_Gesamt()
Dim lng As Long
Dim i As Integer
Sheets("Datenerfassung").Activate
Application.ScreenUpdating = True
With frm_SupplierScoring
.ListBox3.Clear
frm_SupplierScoring.ListBox3.ColumnCount = 18
frm_SupplierScoring.ListBox3.ColumnWidths = "50;50;50;50;50;50;50;50;50;50;50;50;50;50;50; _
50;50;50"
i = 0
For lng = 2 To ActiveSheet.UsedRange.Rows.Count
If InStr(LCase(Cells(lng, 23).Value), LCase(.txt_Gesamt.Value)) > 0 Then
.ListBox3.AddItem Cells(lng, 1).Value
.ListBox3.Column(2, i) = Cells(lng, 2).Value
.ListBox3.Column(3, i) = Cells(lng, 3).Value
.ListBox3.Column(4, i) = Cells(lng, 4).Value
.ListBox3.Column(10, i) = Cells(lng, 10).Value
.ListBox3.Column(11, i) = Cells(lng, 11).Value
.ListBox3.Column(12, i) = Cells(lng, 12).Value
.ListBox3.Column(13, i) = Cells(lng, 13).Value
.ListBox3.Column(9, i) = Cells(lng, 9).Row
i = i + 1
End If
Next lng
End With
End Sub
Bis ".ListBox3.Column(4, i) = Cells(lng, 4).Value" funktioniert alles wunderbar. Wenn ich die nachfolgenden Zeilen mit 5 - 9 durch Nummeriere funktioniert ebenfalls alles nur aber sobald 10 und höher hinterlegt ist springt der Debugger an. Hat hier eine eine Lösung für mich?Gruß Robert