ISNUMBER

B

Brady Snow

I am trying to test whether the active cell is numeric or
not. I use the following code and it tells me that
IsNumber is not a valid sub or function. Can somebody
tell me what I am doing wrong?

If IsNumber(ActiveCell.Offset(0, Y - 1).Value) Then
MsgBox ("True")
End If

Thank you,

Brady Snow
McKinney, Texas
 
K

Keith Willshaw

Brady Snow said:
I am trying to test whether the active cell is numeric or
not. I use the following code and it tells me that
IsNumber is not a valid sub or function. Can somebody
tell me what I am doing wrong?

If IsNumber(ActiveCell.Offset(0, Y - 1).Value) Then
MsgBox ("True")
End If

Thank you,

Try IsNumeric instead of IsNumber

Keith
 
T

Tom Ogilvy

If you want to know if it can be interpreted as a number, use IsNumeric

If IsNumeric(ActiveCell.Offset(0, Y - 1).Value) Then

if you want to know if excel is storing it as a number

If Application.IsNumber(ActiveCell.Offset(0, Y - 1).Value) Then
 

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