ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If cell = number ? (https://www.excelbanter.com/excel-programming/350277-if-cell-%3D-number.html)

Ctech[_69_]

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


Yngve

If cell = number ?
 
Hi Ctech

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


Regards Yngve


Art

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



Art

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



Yngve

If cell = number ?
 


Hi Ctech

Typo

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

Regards Yngve


Ctech[_70_]

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


Gary L Brown

If cell = number ?
 
If Application.WorksheetFunction.IsNumber(ActiveCell. Offset(0, 7).Value) Then
ActiveCell.Value = "False"
End If

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"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



GB

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.

Toppers

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



Dave Peterson

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


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com