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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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