View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
baj baj is offline
external usenet poster
 
Posts: 24
Default Textbox Question

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