ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to Make Multiple List Box Selections Populate A Column in Excel (https://www.excelbanter.com/excel-programming/288828-how-make-multiple-list-box-selections-populate-column-excel.html)

Excel Nerd

How to Make Multiple List Box Selections Populate A Column in Excel
 
Greetings,

Please help...

What I Have:
A user form with 1 populated list box, 1 command buttom that says "Ad
Item", and 1 command button that say "List Complete"

What I Need:
Code For A Loop (perhaps) that will allow the end-user to
1) select an item in the list box,
2)click the "Add Item" button,
3)have the selected item populate to form a list on a spreadsheet
Then
4) Repeat 1,2,and 3 over-and-over again until the end-user selects th
"List Complete" command button.

It would also be nice if the end-user could see the list they ar
building as they are building it.

Please help if you can... Thanks

--
Message posted from http://www.ExcelForum.com


acw[_2_]

How to Make Multiple List Box Selections Populate A Column in Excel
 
H

you don't need a loop on the add Item button. Use the code below for the button and every time it is pressed, it will put the selected item into the next available cell in column A (assuming that there is something in A1 to act as a header). If you have this sheet open when you load the form, you should see the items being added

Range("a65536").End(xlUp).Offset(1#).Value = UserForm1.ListBox1.Tex

In the List Complete button, put the following code (modified to suit the form names). This will hide, then unload the form. Userform1 was the default name when I created my test form

UserForm1.Hid
Unload UserForm

HT

Ton

----- Excel Nerd wrote: ----

Greetings

Please help...

What I Have
A user form with 1 populated list box, 1 command buttom that says "Ad
Item", and 1 command button that say "List Complete

What I Need
Code For A Loop (perhaps) that will allow the end-user to
1) select an item in the list box,
2)click the "Add Item" button,
3)have the selected item populate to form a list on a spreadshee
The
4) Repeat 1,2,and 3 over-and-over again until the end-user selects th
"List Complete" command button.

It would also be nice if the end-user could see the list they ar
building as they are building it

Please help if you can... Thanks


--
Message posted from http://www.ExcelForum.com




All times are GMT +1. The time now is 11:43 PM.

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