View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
ron mann ron mann is offline
external usenet poster
 
Posts: 12
Default sum value of four textboxes into another text box

Hi Eduardo,

Based on the code provided by you I have added the code below and the form
works perfectly. Your advice and assistance with this matter is very much
appreciated.

Thanks

Ron.

Private Sub TextBox11_change()
If IsNumeric(TextBox11.Value) Then
Me.TextBox17.Value = CDbl(TextBox11.Value)
End If

End Sub

Private Sub TextBox12_change()
If IsNumeric(TextBox11.Value) _
And IsNumeric(TextBox12.Value) Then
Me.TextBox17.Value = CDbl(TextBox11.Value) + CDbl(TextBox12.Value)
End If

End Sub

Private Sub TextBox13_change()
If IsNumeric(TextBox11.Value) _
And IsNumeric(TextBox12.Value) _
And IsNumeric(TextBox13.Value) Then
Me.TextBox17.Value = CDbl(TextBox11.Value) + CDbl(TextBox12.Value) +
CDbl(TextBox13.Value)
End If

End Sub
Private Sub TextBox14_change()
If IsNumeric(TextBox11.Value) _
And IsNumeric(TextBox12.Value) _
And IsNumeric(TextBox13.Value) _
And IsNumeric(TextBox14.Value) Then
Me.TextBox17.Value = CDbl(TextBox11.Value) + CDbl(TextBox12.Value) +
CDbl(TextBox13.Value) _
+ CDbl(TextBox14.Value)
End If

End Sub
--
Thanks

Ron


"Eduardo" wrote:

Hi Ron,
try

If IsNumeric(Me.TxtI1.Value) _
And IsNumeric(Me.Txt2.Value) _
And IsNumeric(Me.Txt3.Value) Then
Me.TxtGrossRevenue.Value = CDbl(Me.Txt1.Value) _
+ CDbl(Me.Txt2.Value) _
+ CDbl(Me.Txt3.Value)

Hope this help

"ron mann" wrote:

In my userform I have four text boxes. I need to total the value of the first
three text boxes into the forth text box on a change event in any of the
first three text boxes. The values are all currency to two decimal places.

I have done a bit of reading on this but simply can not crack the answer.

Any assistance with the code to do this would be greatly appreciated.

--
Thanks

Ron