Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default 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   Report Post  
Posted to microsoft.public.excel.programming
bz bz is offline
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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
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
Number versus text format Chuck Bennett[_2_] Excel Discussion (Misc queries) 2 May 20th 09 09:12 PM
Date versus number format Chuck Bennett Excel Discussion (Misc queries) 3 May 20th 09 08:33 PM
Detecting text and returning a value Confuddled User!!!!!!!!!!!!! Excel Discussion (Misc queries) 6 August 28th 07 04:04 PM
Detecting Row number jose luis Excel Programming 3 August 2nd 06 05:22 AM
Detecting Text Numbers Don Wiss Excel Programming 5 July 11th 04 04:05 AM


All times are GMT +1. The time now is 01:01 AM.

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"