Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Anzeige
Inhaltsverzeichnis

Daten von ListBox1 in ListBox2 übernehmen

Forumthread: Daten von ListBox1 in ListBox2 übernehmen

Daten von ListBox1 in ListBox2 übernehmen
15.12.2006 14:16:26
ListBox1
Hallo zusammen,
habe eine Tabelle mit 12 Spalten die in ListBox (lstSource) eingelesen werden.
Der in der ListBox (lstSource) angeklickte Wert wird in die zweite ListBox
lstTarget) übernommen.
Problem: Es werden nur die Ersten 10 Spalten übernommen, wie kann man 12 Spalten in die zweite ListBox übernehmen?
Kann mir jemand helfen?
Vielen Dank im Voraus.
Grüße

Private Sub lstSource_Click()
Dim iCol As Integer
lstTarget.AddItem
For iCol = 0 To 12
lstTarget.List(lstTarget.ListCount - 1, iCol - 1) = lstSource.List(lstSource.ListIndex, iCol - 1)
Next iCol
End Sub


Private Sub UserForm_Initialize()
Dim iRowL As Integer
iRowL = Cells(Rows.Count, 24).End(xlUp).row
lstSource.List = Range( _
Cells(6, 24), Cells(iRowL, 35)).Value
End Sub

Anzeige

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Daten von ListBox1 in ListBox2 übernehmen
15.12.2006 14:20:16
ListBox1
Hallo EP,
Gar nicht!!
Aus der Hilfe:
If you set the ColumnCount property for a list box to 3 on an employee form, one column can list last names, another can list first names, and the third can list employee ID numbers.
Setting ColumnCount to 0 displays zero columns, and setting it to -1 displays all the available columns. For an unbound data source, there is a 10-column limit (0 to 9).
You can use the ColumnWidths property to set the width of the columns displayed in the control.
Gruss Hansueli
Anzeige

Forumthreads zu verwandten Themen

Anzeige
Anzeige