ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   list box (https://www.excelbanter.com/excel-programming/314611-list-box.html)

timO

list box
 
Hello All,

I have created a userform where the user makes inputs
into a text box that populates a list box. There can be
multiple inputs into the list box. My question
is.....once I have multiple inputs into the list box, how
do I recognize each individual entry and transfer them to
my excel sheet? I can populate the listbox, but I am
stuck after that.

Thanks in advance.

Tom Ogilvy

list box
 
Dim rw as Long, i as long
rw = 24

for i = 0 to listbox1.listcount - 1
cells(rw,1) = listbox1.list(i)
rw = rw + 1
Next

--
Regards,
Tom Ogilvy


"TimO" wrote in message
...
Hello All,

I have created a userform where the user makes inputs
into a text box that populates a list box. There can be
multiple inputs into the list box. My question
is.....once I have multiple inputs into the list box, how
do I recognize each individual entry and transfer them to
my excel sheet? I can populate the listbox, but I am
stuck after that.

Thanks in advance.




Dale Preuss[_2_]

list box
 
Tim,

Here is something of the top of my head. It may not be perfext, but it will
get you started... The name of my list box is "lstListBox".

Sub PostListBoxEntries()
Dim i as Integer

For i = 0 to lstListBox.Listcount - 1
ActiveCell.Offset(i,0).Value = lstListBox.List(i)
Next

End Sub

List box entries are addressed by index; the first being index 0. Listcount
returns the number of entries in the list, which is one greater than the
greatest index, hence the "- 1" in the loop.

Hope this works for you.

Dale

"TimO" wrote:

Hello All,

I have created a userform where the user makes inputs
into a text box that populates a list box. There can be
multiple inputs into the list box. My question
is.....once I have multiple inputs into the list box, how
do I recognize each individual entry and transfer them to
my excel sheet? I can populate the listbox, but I am
stuck after that.

Thanks in advance.



All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com