View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2039_] Rick Rothstein \(MVP - VB\)[_2039_] is offline
external usenet poster
 
Posts: 1
Default validation for 10 text boxes

I think you will need to answer a few questions before anyone will be able
to help you out...

1. What do you mean when you say "numbers"... integers only or are floating
point values allowed?

2. When are you attempting to do your "validation"... when the user is
typing into the TextBox itself, or afterwards when all the TextBoxes have
been filled in and an OK button is pressed?

3. In your example labeled #2, did you have something more in mind than
TextBox6.Value < TextBox2.Value?

With respect to my #2 above, I would note that your example show you using a
Change event for you validation which suggests you are trying to validate
the entry as it is being typed in. I would point out that you cannot use
only the Change event by itself to validate values... the user will always
be able to bypass your validation routine by pasting invalid data into the
TextBox.

Rick


"TUNGANA KURMA RAJU" wrote in
message ...
1.how to validate a collection of 10 boxes for numbers only.I know code
for 1
textbox
like
Private Sub TextBox1_change
If TextBox1= vbNullstring Then Exit Sub .... so..so
what validation code for collection of controls in short will do ?
2. I want validation for a TextBox6 for a number not greater than other
TextBox2 in same userForm.