Thread: SUM in Userform
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Keithlo Keithlo is offline
external usenet poster
 
Posts: 62
Default SUM in Userform

Try using the Val function for the values in your text boxes, as in this
snippet:

Private Sub CommandButton1_Click()
Dim My1, My2, My3
My1 = Val(UserForm1.TextBox1.Value)
My2 = Val(UserForm1.TextBox2.Value)
My3 = My1 + My2
UserForm1.TextBox3.Value = My3
End Sub

Hope this helps.

Keith

"excelent" wrote:

Hi Experts
Using Excel 2003

What is the right way to SUM 2 TextBoxes ?

I got a Userfom with 3 Textboxes:

TboxBread ( value is 5.50 )
TboxButter ( value is 4.50 )
TboxSUM ( value has to be 10.00 )

Why the h... isent there a Valuebox to use instead of Textbox ?

any help is velcome.