Userform Validation

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

I have TextBox1,TextBox2, and TextBox3.

What is the code that will throw up a message box error
saying "cannot continue" if textbox1 and textbox2 do NOT
contain a number?

Todd Huttenstine
 
I have TextBox1,TextBox2, and TextBox3.

What is the code that will throw up a message box error
saying "cannot continue" if textbox1 and textbox2 do NOT
contain a number?

Todd Huttenstine

Something like this, perhaps?

Private Sub TextBox1_Change()
If Not IsNumeric(TextBox1.Text) Then
MsgBox "Cannot continue"
Exit Sub
End If
'...
End Sub
 
thanx
-----Original Message-----
Something like this, perhaps?

Private Sub TextBox1_Change()
If Not IsNumeric(TextBox1.Text) Then
MsgBox "Cannot continue"
Exit Sub
End If
'...
End Sub

--
auric "underscore" "underscore" "at" hotmail "dot" com
*****
To be or not to be. That is the result of 2b.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top