Listenbox und if-Funktion
20.10.2015 14:28:41
Matthias
nachfolgend mein Code.
Private Sub UserForm_Initialize()
Dim iRow As Integer
ListBox1.ColumnCount = 4
ListBox1.ColumnWidths = "0,6cm; 2cm; 3,5cm; 3cm"
For iRow = 2 To Range("B65536").End(xlUp).Row
ListBox1.AddItem Cells(iRow, 1)
ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(iRow, 2)
ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(iRow, 3)
ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(iRow, 4)
ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(iRow, 5)
Next
End Sub
Ich möchte aber, dass nur Datensätze aufgeführt werden, wenn in Spalte F der laufenden Zeile oder in Spalte H der laufenden Zeile der Wert kleiner als ein anderer Wert ist.
Bsp.
E3 Mir bringt der immer ein Problem mit der Next-Schleife :(