Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone help me with, I have textbox1 which has a number in it, I want
the user to type in the amount in textbox2 and I want textbox3 to show the total of tb1 + tb2 How do I do this Thanks Greg |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Greg, Here's the code... Dim tbSum tbSum = Val(TetxBox1.Value) + Val(TextBox2.Value) TextBox3.Value = tbSum Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=482469 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
When you design the userform it would also be a good idea to block the (output)TextBox3 from any input with Textbox3.Enabled = False Then I would put a commandbutton on the screen which first makes a control of the numeric values in the two (input)textboxes(1 & 2), if this control is OK then the sum is shown in the outputbox Textbox3, if it's not OK you get a message... so I would adjust the code of Leith to this : Private Sub CommandButton1_Click() If IsNumeric(Val(TextBox2.Value)) And IsNumeric(Val(TextBox1.Value)) Then TextBox3.Value = Val(TextBox2.Value) + Val(TextBox1.Value) Else MsgBox ("Not a Numeric value") End If End Sub Bye Baj |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Textbox Question | Excel Programming | |||
Textbox question | Excel Discussion (Misc queries) | |||
Textbox question | Excel Programming | |||
textbox question | Excel Programming | |||
Textbox question 2 | Excel Programming |