Userform listbox populates after pressing enter

JHogan0721

New Member
Joined
Dec 7, 2016
Messages
12
I am new to VBA and am trying to teach myself while putting together some things for work. I am hoping that one of your geniuses can help me out. I have used this forum often and it has a ton of great people so lets get to it.

Goal: I want to be able to add an item number and quantity to a listbox. Be able to modify the quantity if need be and then send all the data to the appropriate spreadsheet.


I have 2 text boxes in a userform. The first, "Cntrl1", has an item number in it. The second, "Cntrl2", has a quantity. I want to be able to press the enter key after entering a value in Cntrl2, and only if both Cntrl1 and 2 have values in them, and have both the values of Cntrl1 and Cntrl2 populate a listbox in the same user form called "Lstbx1". I want the values to be next to each other. I want to then be able to click on a row in the listbox and take the item number and quantity and return it to the proper textbox so the values can be edited and the original will be replaced by the edited after pressing enter. I believe I have this part down but the goal will be to press a submit button and have the values of the listbox populate a spreadsheet.

I know that sounds a little confusing but I would be happy to provide any additional info if needed.

Thanks for any help.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,214,581
Messages
6,120,368
Members
448,957
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top