Thread: Numbers
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Flanagan Bob Flanagan is offline
external usenet poster
 
Posts: 340
Default Numbers

Try using Application.IsNumber()

Even better is to set a cell to the text box value and then test the value
of the cell to see if the above is true. Why? Try 100%. If in a text box,
it is not a number. But if written to a cell, it is a number.

Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Jevul" wrote in message
...
Hello,

I am trying to figure out a way to prevent users from
entering a "not real" number into a text box. I tried to
ues an If statement.... If Not Isnumeric......
This doesn't seem to work. I had a user input "2345.45-"
with no error but excel igneroed the number in a
calculation. My users are bound to make many mistakes
and I would like to catch them at the time.

Thanks