#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default ISNUMBER

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default ISNUMBER

Hi
try
If IsNumeric(....) then


--
Regards
Frank Kabel
Frankfurt, Germany

Brady Snow wrote:
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default ISNUMBER


"Brady Snow" wrote in message
...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ISNUMBER

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

--
Regards,
Tom Ogilvy


"Brady Snow" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default ISNUMBER

"Tom Ogilvy" wrote...
if you want to know if excel is storing it as a number

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

....

I wonder if VarType would be faster?

If VarType(ActiveCell.Offset(0, Y - 1).Value2) = 5 Then




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ISNUMBER

My guess would be yes.

Good addition.

Thanks,
Tom Ogilvy

"Harlan Grove" wrote in message
...
"Tom Ogilvy" wrote...
if you want to know if excel is storing it as a number

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

...

I wonder if VarType would be faster?

If VarType(ActiveCell.Offset(0, Y - 1).Value2) = 5 Then




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ISNUMBER Arceedee Excel Discussion (Misc queries) 2 January 14th 09 05:09 AM
If, And, Isnumber statement dave roth Excel Discussion (Misc queries) 5 November 12th 08 03:09 PM
ISNUMBER Tanya Excel Worksheet Functions 5 December 6th 07 04:45 PM
ISNUMBER Michael Nol Excel Worksheet Functions 1 March 22nd 06 12:29 AM
ISNUMBER RJJ Excel Worksheet Functions 8 January 4th 06 11:29 PM


All times are GMT +1. The time now is 10:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"