View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Honnore via OfficeKB.com Honnore via OfficeKB.com is offline
external usenet poster
 
Posts: 5
Default Export listbox items to worksheet

I found the solution.The here below code works

Dim c As Variant
Dim i As Integer
c = ThisWorkbook.Worksheets("Sheet1").Range("a1:e5")
For i = 0 To ListBox1.ListCount - 1
Cells(i + 1, 1) = ListBox1.List(i, 1)
Next i


Honnore wrote:
Hi there dear reader...
I have a userform with a listbox.
I would like to export the the items of the listbox into a worksheet.
Here below my code which doesn't work unfortunately. I don't know why.

Dim c As Variant
Dim i As Integer
c = ThisWorkbook.Worksheets("Sheet1").Range("a1:e5")
For i = 0 To ListBox1.ListCount - 1
c(i + 1, 1) = ListBox1.List(i, 1)
Next i


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200904/1