Sum of textboxes. Hopefully really simple

buzz71023

Active Member
Joined
May 29, 2011
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
I have a calculator on a user form and i have most of the other math figured out but i need to know how to code the sum of textbox1 trough textbox 6. I've tried

textbox7.Value = textbox1.Value + textbox2.value + textbox3.value.......and so on
 

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)
Unless I'm missing something obvious, that's exactly it. Didn't it work when you tried it?

Did it produce a compiler error? Did it produce a run-time error? Did it give an incorrect result?
 
Upvote 0
yeah I had a run time error 13'. The first time I tried it it kind of worked, the other calculations worked great but the results came up to be

EXAMPLE
textbox2 RESULT = .10
textbox4 RESULT = .10
textbox6 RESULT = .10
textbox8 RESULT = .10
textbox10 RESULT = .10
textbox11 RESULT = .10

The sum of all in textbox14 = .10.10.10.10.10.10
 
Upvote 0
He is what I have

txtRM1e.Value = (txtBlnd.Value * txtRM1.Value)
txtRM2e.Value = (txtBlnd.Value * txtRM2.Value)
txtRM3e.Value = (txtBlnd.Value * txtRM3.Value)
txtRM4e.Value = (txtBlnd.Value * txtRM4.Value)
txtRM5e.Value = (txtBlnd.Value * txtRM5.Value)
txtRM6e.Value = (txtBlnd.Value * txtRM6.Value)

txtTtlRM = txtRM1e.Value + txtRM2e.Value + txtRM3e.Value + txtRM4e.Value + txtRM5e.Value + txtRM6e.Value
 
Upvote 0
Instead of TextBox.Value, use Val(TextBox):-
Code:
txtRM1e = Val(txtBlnd) * Val(txtRM1)
txtRM2e = Val(txtBlnd) * Val(txtRM2)
txtRM3e = Val(txtBlnd) * Val(txtRM3)
txtRM4e = Val(txtBlnd) * Val(txtRM4)
txtRM5e = Val(txtBlnd) * Val(txtRM5)
txtRM6e = Val(txtBlnd) * Val(txtRM6)
 
txtTtlRM = Val(txtRM1e) + Val(txtRM2e) + Val(txtRM3e) + Val(txtRM4e) + Val(txtRM5e) + Val(txtRM6e)
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,711
Members
452,939
Latest member
WCrawford

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