Error check on range of numbers

C

corky_guy

Hi -

I'm trying to error check on a specific range of numbers but I can't
get it to work. I need to prevent user from inputting any numeric
value from 65000 - 65999. The code I'm using seems to only error
check a single digit (either 6, 5, 0, or 9) instead of looking at the
whole number.

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
With Me.TextBox1
If (.Text) Like "[65000 - 65999]" Then
MsgBox "Please use the proper range of numbers!"
Cancel = True
End If
End With
End Sub

I'm sure it's something easy, I just don't know how to fix.

Thanks for your help!
 

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

Top