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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,221,813
Messages
6,162,117
Members
451,743
Latest member
matt3388

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