Sum total of 3 Textboxes

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,975
Office Version
  1. 2007
Platform
  1. Windows
On a userform where I have Textbox1 Textbox3 & Textbox 6

Each will have a numerical value shown.
So in Textbox8 how can the total be shown which adds those 3 values.

Textbox1 = 5
Textbox3 = 7
Textbox6 = 5

So Textbox8 should then display 17

Thought it would easy enough but how wrong I was.
 
The basic principle would be something like the below.
You would then need to cater for validation and what data types are being entered (eg does it have commas) and how you want the output to look.

VBA Code:
Private Sub TextBox1_Change()
    Call UpdateTxtBox8
End Sub


Private Sub TextBox3_Change()
    Call UpdateTxtBox8
End Sub


Private Sub TextBox6_Change()
    Call UpdateTxtBox8
End Sub


Private Sub UpdateTxtBox8()
    TextBox8.Value = Val(TextBox1.Value) _
                        + Val(TextBox3.Value) _
                        + Val(TextBox6.Value)
End Sub
 
Upvote 0
Solution

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