Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I need Help in a form


I am trying to make a simple form calculator!

2 Textboxes, and then when I click a button another textbox display
the sum of the 2 textboxes.

How do I do this? Does the answer need to appear in a label o
textbox?

I think I need to have a button so that the form refreshes and I ge
the answer, is this the case??

thank

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default I need Help in a form

1) In VBA Editor, insert a new UserForm to your project
2) On the userform, place two text boxes. (Their names are "TextBox1" and "TextBox2" for example)
3) Place one Label. (It name is "Label1" for example)
4) Place one command button (It name is "CommandButton1" for example)
5) Double-click the command button to insert some code

Private Sub CommandButton1_Click()
Label1.Caption = TextBox1.Value + TextBox2.Value
End Sub


----- Xispo wrote: -----


I am trying to make a simple form calculator!

2 Textboxes, and then when I click a button another textbox displays
the sum of the 2 textboxes.

How do I do this? Does the answer need to appear in a label or
textbox?

I think I need to have a button so that the form refreshes and I get
the answer, is this the case??

thanks


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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I need Help in a form


Thanks for that, it almost worked, but if I put 1 in a box and 2 in th
other, it give 12, ie it is joinging them not mathematically addin
them, how do I fix this?

thank

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default I need Help in a form

Try

Private Sub CommandButton1_Click(
Label1.Caption = Val(TextBox1.Text) + Val(TextBox2.Value
End Su

----- Xispo wrote: ----


Thanks for that, it almost worked, but if I put 1 in a box and 2 in th
other, it give 12, ie it is joinging them not mathematically addin
them, how do I fix this

thank


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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I need Help in a form


Thats better, Thanks!!!

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

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
Formula (off form) that completes form data based on a result lldiel Excel Worksheet Functions 2 November 24th 09 11:09 PM
excel form. Need data extracted to spreadsheet each time a form co MikeR-Oz Excel Discussion (Misc queries) 4 April 5th 09 05:18 AM
Using a template form, advance a form number everytime you open ShoDan Excel Discussion (Misc queries) 1 January 31st 08 01:34 PM
Can a form made in Excel 2002 be converted into a fillable form? Paraclete Excel Discussion (Misc queries) 1 February 20th 07 09:20 PM
how can I make a form number change everytime the form is opened babydumplingspita Excel Worksheet Functions 1 October 10th 05 07:58 PM


All times are GMT +1. The time now is 09:43 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"