ich habe ein Problem mit dem Füllen der Listbox.
Nachstehende Userform_Initialize benutze ich:
Private Sub Userform_initialize()
Dim i As Long
With ListBox1
.Clear
.ColumnCount = 6
.ColumnWidths = "3,0 cm;4,5 cm;4,5 cm;3,0 cm;3,0 cm;3,0 cm"
For i = 9 To 87
.AddItem Cells(i, 2) 'SpalteB in erste Spalte
.List(.ListCount - 1, 1) = Cells(i, 3) 'SpalteC in zweite Spalte
.List(.ListCount - 1, 2) = Cells(i, 4) 'SpalteD in dritte Spalte
.List(.ListCount - 1, 3) = Format(Cells(i, 5), "#,###.00 ") 'SpalteE in dritte Spalte
.List(.ListCount - 1, 4) = Format(Cells(i, 6), "#,###.00 ") 'SpalteF in dritte Spalte
.List(.ListCount - 1, 5) = Format(Cells(i, 7), "#,###.00 ") 'SpalteG in dritte Spalte
Next
End With
'End With
With Sheets("Hilfstabelle")
ComboBox1.RowSource = "Hilfstabelle!B2:B" & .Cells(Rows.Count, 2).End(xlUp).Row
End With
End Sub
Den Wert "For i = 9 To 87" möchte ich jedoch insoweit ändern, dass das Befüllen nicht bei Zeile 87 endet sondern bis zur letzten beschriebenen Zeile.
Könnt ihr mir bitte dabei helfen.
Gruss
Peter