View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
GeorgeFD29 GeorgeFD29 is offline
external usenet poster
 
Posts: 6
Default returning values multi column listbox

Tom,
When I apply the code:
With Userform1
for i = 0 to 2
cells(rw,i+1) = .Listbox1.list(.Listbox1.listindex,i)
Next
End With

I get an 'application defined or object defined error'.

I put the code on the doubleclick event of the list box.

This is the code that sets up the 3 column list box:
ReDim b(c, 3)
For x = 0 To c - 1
b(x, 0) = a(x, 0)
b(x, 1) = a(x, 1)
b(x, 2) = a(x, 2)
Next
ListBox1.List = b

and what I tried to do was to return the data in column A of the box to ie
row1 columnA of the spreadsheet, data in column B of the listbox to row1
columnB and data from the third column of the listbox to row1 columnC

Thanks for helping,
George


"Tom Ogilvy" wrote:

With Userform1
for i = 0 to 2
cells(rw,i+1) = .Listbox1.list(.Listbox1.listindex,i)
Next
End With


--
Regards,
Tom Ogilvy



"GeorgeFD29" wrote in message
...
I have a three column listbox. What I'd like to do, is return the data in
all three columns to a cells in a worksheet. However, all I'm able to do

is
return the first column's data. Anyone have any thoughts?