Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default 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
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
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) Corey Excel Programming 2 January 9th 07 01:01 PM
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM


All times are GMT +1. The time now is 02:45 PM.

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"