Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SUM in Userform
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
SUM in Userform
TboxSum.Value = Val(TboxBread.Value) + Val(TboxButter.Value)
-- Regards, Tom Ogilvy "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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
SUM in Userform
ok that would do the trick :-)
thanks both Keithlo and Tom "Tom Ogilvy" skrev: TboxSum.Value = Val(TboxBread.Value) + Val(TboxButter.Value) -- Regards, Tom Ogilvy "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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) | Excel Programming | |||
Userform to enter values and shown in same userform in list | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Access from add_in userform to main template userform.... | Excel Programming |