View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Add values of textboxes together

Candee,

Try something like the following code:

Dim Total As Double
With Me
With .TextBox1
If IsNumeric(.Text) Then
Total = Total + CDbl(.Text)
End If
End With
With .TextBox2
If IsNumeric(.Text) Then
Total = Total + CDbl(.Text)
End If
End With
With .TextBox3
If IsNumeric(.Text) Then
Total = Total + CDbl(.Text)
End If
End With
With .TextBox4
If IsNumeric(.Text) Then
Total = Total + CDbl(.Text)
End If
End With
.TextBox5.Text = Format(Total, "#,##0.00")

Range("A1").Value = Total
End With



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Candee" wrote in message
...

Hello all

I have a userform that has 5 text boxes on it (Textbox1,

Textbox2,
etc.) where a user will enter a number in the first 4 boxes.

What I
would like to happen is in Textbox5 to add the entered numbers

from the
first 4 boxes together to give me a total, which will then be
transferred to a spreadsheet(I have that part figured out, just

need
help with the addition part).

Thanks in advance....


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide

to creating financial statements