Quick way to add the value in many textboxes in a userform

birdieman

Well-known Member
Joined
Jan 13, 2016
Messages
551
I have a userform in which I need to add the values in about 25 textboxes (there are formatted numbers in the boxes, like $5,000). Is there a quick and easy way to do it without adding one by one (TextBox50 + TextBox52, etc.)? If it helps, the names/labels are all TextBoxXX (XX is a number) and all TextBox numbers are EVEN numbers between 50 and 100. Thanks
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Do you want to add all of the textboxes or is it pairs of textboxes?

Where should the result(s) go?
 
Upvote 0
I want to add the values in all EVEN textboxes from say Textbox150 to TextBox198 (Textbox 150+ textbox 152 + textbox 154....+TextBox198) and put result in Textbox200
 
Upvote 0
Are they all formatted the same?
 
Upvote 0
Note I'm asking about formatting because we need to convert the text in the textboxes to numeric to add the values, looping through the textboxes is the easy part.

For example to loop through every even textbox from 150 to 198 we can use this.
Code:
For I = 150 To 198 Step 2
    MsgBox Me.Controls("Textbox" & I).Value
Next I
 
Upvote 0

Forum statistics

Threads
1,214,959
Messages
6,122,476
Members
449,087
Latest member
RExcelSearch

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