Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting a number versus text?
Does anyone know how to tell if a cell is a number when the value in
that cell is actually text? In other words if I have the character 3 in a cell and the cell is in the format of "text" how can I tell that this is in fact a number in my code. I tried using the cint function but I got an error message upon performing this function. Thanks, Chet |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting a number versus text?
How about using ISNUMBER or ISTEXT?
"Chet" wrote: Does anyone know how to tell if a cell is a number when the value in that cell is actually text? In other words if I have the character 3 in a cell and the cell is in the format of "text" how can I tell that this is in fact a number in my code. I tried using the cint function but I got an error message upon performing this function. Thanks, Chet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting a number versus text?
One way:
If IsNumeric(Cells(1, 1).Value) Then .... In article .com, "Chet" wrote: Does anyone know how to tell if a cell is a number when the value in that cell is actually text? In other words if I have the character 3 in a cell and the cell is in the format of "text" how can I tell that this is in fact a number in my code. I tried using the cint function but I got an error message upon performing this function. Thanks, Chet |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting a number versus text?
Thanks much.. ! Will give it a try.. Chet
JE McGimpsey wrote: One way: If IsNumeric(Cells(1, 1).Value) Then .... In article .com, "Chet" wrote: Does anyone know how to tell if a cell is a number when the value in that cell is actually text? In other words if I have the character 3 in a cell and the cell is in the format of "text" how can I tell that this is in fact a number in my code. I tried using the cint function but I got an error message upon performing this function. Thanks, Chet |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting a number versus text?
"Chet" wrote in news:1163729215.588617.181400
@m73g2000cwd.googlegroups.com: Did NOT work for me when the cell held a number formatted as text. But If Val(Format(Target.Value, "#")) 0 Then Did work (assuming the numbers were all larger than zero, which they are in my case.) Thanks much.. ! Will give it a try.. Chet JE McGimpsey wrote: One way: If IsNumeric(Cells(1, 1).Value) Then .... In article .com, "Chet" wrote: Does anyone know how to tell if a cell is a number when the value in that cell is actually text? In other words if I have the character 3 in a cell and the cell is in the format of "text" how can I tell that this is in fact a number in my code. I tried using the cint function but I got an error message upon performing this function. Thanks, Chet -- bz please pardon my infinite ignorance, the set-of-things-I-do-not-know is an infinite set. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting a number versus text?
What do you have in your cell? IsNumeric() certainly works for me with
numbers formatted as text. In article 9, bz wrote: "Chet" wrote in news:1163729215.588617.181400 @m73g2000cwd.googlegroups.com: Did NOT work for me when the cell held a number formatted as text. But If Val(Format(Target.Value, "#")) 0 Then Did work (assuming the numbers were all larger than zero, which they are in my case.) Thanks much.. ! Will give it a try.. Chet JE McGimpsey wrote: One way: If IsNumeric(Cells(1, 1).Value) Then .... In article .com, "Chet" wrote: Does anyone know how to tell if a cell is a number when the value in that cell is actually text? In other words if I have the character 3 in a cell and the cell is in the format of "text" how can I tell that this is in fact a number in my code. I tried using the cint function but I got an error message upon performing this function. Thanks, Chet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Number versus text format | Excel Discussion (Misc queries) | |||
Date versus number format | Excel Discussion (Misc queries) | |||
Detecting text and returning a value | Excel Discussion (Misc queries) | |||
Detecting Row number | Excel Programming | |||
Detecting Text Numbers | Excel Programming |