Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel User Form Validation

Status
Not open for further replies.

shadyness

MIS
Dec 21, 2001
89
US
I usually work in different applications, usually in VB6 actually, and if I want to check if an input field is numeric, I usually use the IsNumeric Function. However, in an excel user form I made the code:
Code:
If IsNumeric(Me.TextBox1.Value And Me.TextBox2.Value _
             And Me.TextBox3.Value And Me.TextBox4.Value And Me.TextBox5.Value _
             And Me.TextBox6.Value And Me.TextBox7.Value And Me.TextBox8.Value _
             And Me.TextBox9.Value And Me.TextBox10.Value And Me.TextBox11.Value _
             And Me.TextBox12.Value And Me.TextBox13.Value And Me.TextBox14.Value _
             ) Then


produces a Type Mis-Match error if one field is alpha. The Else statement after all of this is a simple message box instructing a re-inspection of the fields. This has worked many times in my previous VB projects. So what am I missing that I need to do in excel?

Thanks in advance for any assistance. . . .


<== Some people say they are afraid of heights. With me its table widths. ==>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top