ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding items to a spreadsheet from a user form listbox (https://www.excelbanter.com/excel-programming/284225-adding-items-spreadsheet-user-form-listbox.html)

aet-inc[_4_]

Adding items to a spreadsheet from a user form listbox
 

Hi:

Can someone please tell me how to do the following?:

I have a spreadsheet that contains a command button that shows a
UserForm. The UserForm contains a ListBox. How do I add items from the
ListBox to the spreadsheet? I want to be able to select an item from
the ListBox, hit an "Add Item" command button and have the selected
item be added to the spreadsheet. The ListBox contains a 6 column
database that will be used to insert the selected items into a matching
6 column spreadsheet.

Is this possible?

Thank you for your help!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements

Cliff Myers

Adding items to a spreadsheet from a user form listbox
 
In your AddItem commandbutton_click event just add:

'change to your needs
sheet1.cells(5,5) = userform1.listbox1.value
sheet1.cells(5,6) = userform1.listbox2.value
specifying the sheet will ensure correct worksheet placement. Cells(5,5) is
E5.

HTH

"aet-inc" wrote in message
...

Hi:

Can someone please tell me how to do the following?:

I have a spreadsheet that contains a command button that shows a
UserForm. The UserForm contains a ListBox. How do I add items from the
ListBox to the spreadsheet? I want to be able to select an item from
the ListBox, hit an "Add Item" command button and have the selected
item be added to the spreadsheet. The ListBox contains a 6 column
database that will be used to insert the selected items into a matching
6 column spreadsheet.

Is this possible?

Thank you for your help!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements




All times are GMT +1. The time now is 10:18 AM.

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