Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
If cell = number ?
Hi Ctech
Try this If ISNUMBER(ActiveCell.Offset(0, 7).Value) Then ActiveCell = "False" End If Regards Yngve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
If cell = number ?
Hi Ctech Typo If IsNumeric(ActiveCell.Offset(0, 7).Value) Then ActiveCell = "False" End If Regards Yngve |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Random cell/number and dont repeat selected cell/number | Excel Discussion (Misc queries) | |||
formatting cell number based on previous cell number | Excel Discussion (Misc queries) | |||
Count number of times a specific number is displayed in a cell ran | Excel Worksheet Functions | |||
command to return the row number or cell number in excel? | Excel Programming | |||
making a cell fixed number to a input number | Excel Programming |