Export listbox items to worksheet

  • Thread starter Honnore via OfficeKB.com
  • Start date
H

Honnore via OfficeKB.com

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
 
H

Honnore via OfficeKB.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top