heute möchte ich euch wieder einmal um Mithilfe bei meinem Problem bitten...
Ich möchte eine ListBox ohne Leerzeilen befüllen.
Wer kann den folgenden Code dahingehend "umbasteln"?
Private Sub UserForm_Initialize()
Dim arr() As Variant
Dim i As Integer
Dim iRow As Integer
Dim iAnz As Integer
With Sheets("Kunden")
iAnz = WorksheetFunction.CountA(.Range("b4:f5000"))
ReDim arr(0 To iAnz - 1, 0 To 4)
iRow = 0
For i = 4 To 5000
If .Cells(i, 2).Value "" Then
arr(iRow, 0) = .Cells(i, 2)
arr(iRow, 1) = .Cells(i, 5)
arr(iRow, 2) = .Cells(i, 4)
'arr(iRow, 3) = .Cells(i, 6)
'arr(iRow, 3) = .Cells(i, 6)
iRow = iRow + 1
End If
Next
End With
ListBox1.List = arr
End Sub
Danke für eure Hilfe!
Gruss, Ina