PC Review


Reply
Thread Tools Rate Thread

check data type in excel

 
 
Grey
Guest
Posts: n/a
 
      31st Aug 2004
I have a column with number and string. if it is number, i need to do
something, while string, i need to do other.
is it possible to check the data type of one cell??

million thanks


 
Reply With Quote
 
 
 
 
RagDyeR
Guest
Posts: n/a
 
      31st Aug 2004
One way would be to use IsText(), and/or IsNumber().
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



"Grey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
I have a column with number and string. if it is number, i need to do
something, while string, i need to do other.
is it possible to check the data type of one cell??

million thanks



 
Reply With Quote
 
Paul Cunliffe
Guest
Posts: n/a
 
      1st Sep 2004
"Grey" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> I have a column with number and string. if it is number, i need to do
> something, while string, i need to do other.
> is it possible to check the data type of one cell??
>
> million thanks


Try

=IF(CELL("type",A1)="v","Do something if number","Do something if
string")

CELL("type",A1) returns text value corresponding to the type of data
in the cell. Returns "b" for blank if the cell is empty, "l" for label
if the cell contains a text constant, and "v" for value if the cell
contains anything else.

Regards
 
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
How can I check the data type of a field in the DataReader ? fniles Microsoft VB .NET 4 18th Feb 2011 06:14 AM
Check a column for correct type of data =?Utf-8?B?VFdpbHNvbg==?= Microsoft Excel Programming 1 19th Oct 2006 02:34 PM
userform-check data type =?Utf-8?B?eGxjaGFybGll?= Microsoft Excel Programming 3 28th Mar 2005 03:11 PM
How to check a Variant for its data type TBA Microsoft Excel Programming 4 9th Jan 2004 11:04 PM
strict data type check Sam Sungshik Kong Microsoft C# .NET 2 28th Jul 2003 08:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:48 PM.