Help Populating ListBox

Scott M

Board Regular
Joined
Dec 31, 2011
Messages
152
I would like to populate a list Box with the sum of the values entered in the textboxes on a user form without putting any data in a worksheet is this possible?
For example the user brings up the user form and enters 2 in textBox1 and 2 in textBox2 then the list box would show 4
 
Thanks Vladimir for your help the code works just fine but it is rounding the 4th digit up witch I am sure that is what it should do. However I need the digits just cut off at 4 digits for example. The result that I was getting was 16.859375 Now I am getting 16.8594. I need it to be 16.8593.Is there any way to make this code do that?
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Scott

I thought you had a problem with the code or result.

If you don't want the value 'rounded' when it's formatted then round it before you format it.

Something like this perhaps.
Code:
LstBxResult.AddItem Format(Application.RoundDown(x, 4), "#0.0000")
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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