List Data to Single String

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way that I can take the data from a ListBox (12 items) and load
into a merged cell as a single string

ListBox1 data
Cake
Ice Cream to Cake / Ice Cream /
Pies / Cookies
Pies
Cookies
 
With Userform1.Listbox
for i = 0 to .listcount - 1
if i <> .listcount - 1 then
sStr = sStr & .list(i) & " / "
else
sStr = sStr & .List(i)
end if
Next
End With
' now assign to the cell in the upper left corner
' of the merged cell area

Range("B9").Value = sStr
 

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

Back
Top