Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default sum value of four textboxes into another text box

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,276
Default sum value of four textboxes into another text box

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text blocks and multiline textboxes Mats Samson Excel Programming 0 September 20th 07 07:52 PM
Highlight text in textboxes Frederick Chow Excel Programming 2 January 3rd 06 05:26 PM
Clearing text in TextBoxes CG Rosén Excel Programming 3 August 18th 05 10:01 PM
Default text in textboxes MissGenie Excel Discussion (Misc queries) 1 June 7th 05 01:22 PM
Text length and TextBoxes Ron_D[_2_] Excel Programming 4 December 28th 04 09:47 AM


All times are GMT +1. The time now is 01:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"