Hi Villalobos,
I assume when you say decimals you mean integers (whole numers) - please correct me if you mean the part of the number after the decimal point.
This code will sum only the positive integers.
Private Sub CommandButton1_Click()
Dim t1, t2
Dim total As Integer
t1 = Split(TextBox1.Value, ",")
t2 = Split(TextBox2.Value, ",")
For x = LBound(t1) To UBound(t1)
If t1(x) > 0 Then total = total + t1(x)
Next x
For x = LBound(t2) To UBound(t2)
If t2(x) > 0 Then total = total + t2(x)
Next x
TextBox3.Value = total
End Sub
Thanks,
Duncan
Bookmarks