Adding items to a spreadsheet from a user form listbox

A

aet-inc

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!
 
C

Cliff Myers

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 said:
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!


------------------------------------------------



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

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