Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If cell = number ?


Hi

If ActiveCell.Offset(0, 7).Value = ISNUMBER Then
ActiveCell = "False"
End If


What is wrong here

--
Ctec
-----------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...fo&userid=2774
View this thread: http://www.excelforum.com/showthread.php?threadid=50083

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default If cell = number ?

Hi Ctech

Try this
If ISNUMBER(ActiveCell.Offset(0, 7).Value) Then
ActiveCell = "False"
End If


Regards Yngve

  #3   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default If cell = number ?

Try this:

If IsNumeric(ActiveCell.Offset(0, 7)) Then
ActiveCell = "False"
End If

Also note that an empty cell with trigger this.

Art

"Ctech" wrote:


Hi

If ActiveCell.Offset(0, 7).Value = ISNUMBER Then
ActiveCell = "False"
End If


What is wrong here?


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=500831


  #4   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default If cell = number ?

Also a good reason to put: Option Explicit at the beginning of your code.

Your code thought that ISNUMBER is a variable name.

Art

"Ctech" wrote:


Hi

If ActiveCell.Offset(0, 7).Value = ISNUMBER Then
ActiveCell = "False"
End If


What is wrong here?


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=500831


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default If cell = number ?



Hi Ctech

Typo

If IsNumeric(ActiveCell.Offset(0, 7).Value) Then
ActiveCell = "False"
End If

Regards Yngve



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If cell = number ?


I get error "Sub of function not known"

--
Ctec
-----------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...fo&userid=2774
View this thread: http://www.excelforum.com/showthread.php?threadid=50083

  #8   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default If cell = number ?

To build on what Art said,

If IsNumeric(ActiveCell.Offset(0, 7)) and ActiveCell.Offset(0,7) < "" Then
ActiveCell = "False"
End If

This (or something similar) will check to make sure that the cell is not
blank as well.
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default If cell = number ?

I think this is what you want:

If IsNumeric(ActiveCell.Offset(0, 7).Value ) then
ActiveCell = "False"
end if

Your code would compare with a variable IsNumber which wouldn't (doesn't)
exist.

"Ctech" wrote:


Hi

If ActiveCell.Offset(0, 7).Value = ISNUMBER Then
ActiveCell = "False"
End If


What is wrong here?


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=500831


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default If cell = number ?

One of the differences between application.isnumber (or
application.worksheetfunction.isnumber) and VBA's isnumeric is how digits
masquerading as text is treated.

If the cell is formatted as text and contains 123 ('123), then VBA's isnumeric()
will be true. Application.isnumber() will return false. The worksheet function
is much less forgiving--it really has to be a number.

Ctech wrote:

Hi

If ActiveCell.Offset(0, 7).Value = ISNUMBER Then
ActiveCell = "False"
End If

What is wrong here?

--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=500831


--

Dave Peterson
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
Random cell/number and dont repeat selected cell/number Hector PR Excel Discussion (Misc queries) 0 October 16th 06 05:02 PM
formatting cell number based on previous cell number Pasquini Excel Discussion (Misc queries) 3 June 20th 06 06:36 AM
Count number of times a specific number is displayed in a cell ran subs Excel Worksheet Functions 1 June 27th 05 05:01 PM
command to return the row number or cell number in excel? desmondleow[_5_] Excel Programming 1 December 11th 03 10:51 AM
making a cell fixed number to a input number fwday[_2_] Excel Programming 1 October 25th 03 02:38 AM


All times are GMT +1. The time now is 06:32 PM.

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

About Us

"It's about Microsoft Excel"