List Befüllung pvarg Column erhöhen
20.05.2019 11:01:13
biwi
ich habe ein Problem mit einer ListBox in einer UserForm. In der Userform möchte ich mehrere Spalten aus einem Tabellenblatt darstellen. Das klappt soweit auch ganz gut nur bei der Letzten Spalte streikt Excel bei mir mit der Fehlermeldung, dass die Eigenschaft List nicht gesetzt werden konnte wegen eines ungültigen Eigenschaftenwerts. Der Fehler wird durch die letzte auskommentierte Zeile hier im Code ausgelöst):
ListBox1.AddItem
ListBox1.List(ListBox1.ListCount - 1, 0) = .Cells(n + Row - 1, Column + 0).Value
ListBox1.List(ListBox1.ListCount - 1, 1) = .Cells(n + Row - 1, Column + 1).Value
ListBox1.List(ListBox1.ListCount - 1, 2) = .Cells(n + Row - 1, Column + 2).Value
ListBox1.List(ListBox1.ListCount - 1, 3) = .Cells(n + Row - 1, Column + 3).Value
ListBox1.List(ListBox1.ListCount - 1, 4) = .Cells(n + Row - 1, Column + 4).Value
ListBox1.List(ListBox1.ListCount - 1, 5) = .Cells(n + Row - 1, Column + 5).Value
ListBox1.List(ListBox1.ListCount - 1, 6) = .Cells(n + Row - 1, Column + 6).Value
ListBox1.List(ListBox1.ListCount - 1, 7) = .Cells(n + Row - 1, Column + 7).Value
ListBox1.List(ListBox1.ListCount - 1, 8) = .Cells(n + Row - 1, Column + 24).Value
ListBox1.List(ListBox1.ListCount - 1, 9) = .Cells(n + Row - 1, Column + 25).Value
'ListBox1.List(ListBox1.ListCount - 1, 10) = .Cells(n + Row - 1, Column + 26).Value
Das Problem hier ist die pvargColumn i.H.v 10 bei ListBox1.List() Ich weiß aber nicht wie ich die pvarg Column "hochsetzen" kann sodass 10 auch noch erlaubt ist?
Ich hoffe das ist halbwegs verständlich.
Vielen Dank im Voraus für jegliche Hilfe!