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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking for numeric values

Status
Not open for further replies.

Tom21

Programmer
Jun 5, 2001
9
GB
An easy one for you pro's out there.....

How do I go about checking for a 'numeric value only' in a cell, even if the cell is text based?

Cheers,

Tom.
 
Try this.

=ISNUMBER(A1*1)

the *1 is there to get round the text format problem.
 
It's tellin' me that ISNUMBER isn't a function. I couldn't find the thing in the help file either.

I was looking at 'Cint' as a conversion function, but I don't know if I can put that in an if statement, becuase it'll probably throw up an error.....

In which case how would I deal with that?

I.E. If not error from function then
some code
end if

Nice one,

Tom.

 
Sorry, I thought you were in Excel not VBA!

use this.

Information.IsNumeric(MyVal)

Where MyVal is the value you are checking.
 
That's done the trick. Thanks a lot mate.

Tom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top