View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Multiple Column Listbox

Load it like so

Dim ary, i, j

ary = [{"Bob","M", 123;"Lynne","F",898;"Amy","F",543}]

With ListBox1
For i = 1 To 3
.AddItem ary(i, 1)
For j = 2 To 3
.List(.ListCount - 1, j - 1) = ary(i, j)
Next j
Next i
End With

retrieve it like so

Dim i As Long
Dim j As Long
Dim iRow As Long
iRow = 10
With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
For j = 1 To .ColumnCount
ActiveSheet.Cells(iRow, j).Value = .List(i, j - 1)
Next
iRow = iRow + 1
End If
Next i
End With

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
oups.com...
Hello.. I am having trouble finding a way to create a multiple column
list box..
I have two columns of data, assume they are in Sheet1 cells A1:B10
I created the ListBox with Control Toolbox named ListBox1

Regards,

Matt