PC Review


Reply
Thread Tools Rate Thread

Detecting a number versus text?

 
 
Chet
Guest
Posts: n/a
 
      17th Nov 2006
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 With Quote
 
 
 
 
=?Utf-8?B?Ymlnd2hlZWw=?=
Guest
Posts: n/a
 
      17th Nov 2006
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
>
>

 
Reply With Quote
 
JE McGimpsey
Guest
Posts: n/a
 
      17th Nov 2006
One way:

If IsNumeric(Cells(1, 1).Value) Then
....


In article <(E-Mail Removed)>,
"Chet" <(E-Mail Removed)> 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 With Quote
 
Chet
Guest
Posts: n/a
 
      17th Nov 2006
Thanks much.. ! Will give it a try.. Chet
JE McGimpsey wrote:
> One way:
>
> If IsNumeric(Cells(1, 1).Value) Then
> ....
>
>
> In article <(E-Mail Removed)>,
> "Chet" <(E-Mail Removed)> 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 With Quote
 
bz
Guest
Posts: n/a
 
      17th Nov 2006
"Chet" <(E-Mail Removed)> 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 <(E-Mail Removed)>,
>> "Chet" <(E-Mail Removed)> 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.

bz+(E-Mail Removed)
 
Reply With Quote
 
JE McGimpsey
Guest
Posts: n/a
 
      17th Nov 2006
What do you have in your cell? IsNumeric() certainly works for me with
numbers formatted as text.


In article <Xns987E2CD3DAAFWQAHBGMXSZHVspammote@130.39.198.139>,
bz <bz+(E-Mail Removed)> wrote:

> "Chet" <(E-Mail Removed)> 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 <(E-Mail Removed)>,
> >> "Chet" <(E-Mail Removed)> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number versus text format Chuck Bennett Microsoft Excel Misc 4 20th May 2009 09:12 PM
Number versus text format Chuck Bennett Microsoft Excel Misc 0 20th May 2009 08:20 PM
Detecting Row number jose luis Microsoft Excel Programming 3 2nd Aug 2006 05:22 AM
Detecting bin\debug versus bin\release? AdamM Microsoft C# .NET 3 20th Feb 2006 09:36 AM
entering number versus text. DONNAK Microsoft Access Database Table Design 1 27th Apr 2005 04:33 AM


Features
 

Advertising
 

Newsgroups
 


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