ehayman2003
New Member
- Joined
- Jul 3, 2019
- Messages
- 2
My apologies as i have not used userforms much.
I have a userform and i am trying to total textboxes 1-18 in textbox 19, automatically:
I have the following code:
Public Sub recalculatetotal()
'calculates total score in textbox 19
Dim Tot As Double
On Error Resume Next
Tot = Tot + CDbl(TextBox1.Text)
Tot = Tot + CDbl(TextBox2.Text)
Tot = Tot + CDbl(TextBox3.Text)
Tot = Tot + CDbl(TextBox4.Text)
Tot = Tot + CDbl(TextBox5.Text)
Tot = Tot + CDbl(TextBox6.Text)
Tot = Tot + CDbl(TextBox7.Text)
Tot = Tot + CDbl(TextBox8.Text)
Tot = Tot + CDbl(TextBox9.Text)
Tot = Tot + CDbl(TextBox10.Text)
Tot = Tot + CDbl(TextBox11.Text)
Tot = Tot + CDbl(TextBox12.Text)
Tot = Tot + CDbl(TextBox13.Text)
Tot = Tot + CDbl(TextBox14.Text)
Tot = Tot + CDbl(TextBox15.Text)
Tot = Tot + CDbl(TextBox16.Text)
Tot = Tot + CDbl(TextBox17.Text)
Tot = Tot + CDbl(TextBox18.Text)
TextBox19.Text = Tot
End Sub
Private Sub TextBox19_Change()
Call recalculatetotal
When I open the form and enter data in each text box, box 19 does not populate.
Additionally, this code is in the general section of the module.
any help is greatly appreciated.
thanks in advance.
I have a userform and i am trying to total textboxes 1-18 in textbox 19, automatically:
I have the following code:
Public Sub recalculatetotal()
'calculates total score in textbox 19
Dim Tot As Double
On Error Resume Next
Tot = Tot + CDbl(TextBox1.Text)
Tot = Tot + CDbl(TextBox2.Text)
Tot = Tot + CDbl(TextBox3.Text)
Tot = Tot + CDbl(TextBox4.Text)
Tot = Tot + CDbl(TextBox5.Text)
Tot = Tot + CDbl(TextBox6.Text)
Tot = Tot + CDbl(TextBox7.Text)
Tot = Tot + CDbl(TextBox8.Text)
Tot = Tot + CDbl(TextBox9.Text)
Tot = Tot + CDbl(TextBox10.Text)
Tot = Tot + CDbl(TextBox11.Text)
Tot = Tot + CDbl(TextBox12.Text)
Tot = Tot + CDbl(TextBox13.Text)
Tot = Tot + CDbl(TextBox14.Text)
Tot = Tot + CDbl(TextBox15.Text)
Tot = Tot + CDbl(TextBox16.Text)
Tot = Tot + CDbl(TextBox17.Text)
Tot = Tot + CDbl(TextBox18.Text)
TextBox19.Text = Tot
End Sub
Private Sub TextBox19_Change()
Call recalculatetotal
When I open the form and enter data in each text box, box 19 does not populate.
Additionally, this code is in the general section of the module.
any help is greatly appreciated.
thanks in advance.