Determining How An Existing Cell Is Formatted ?

ello,

Is it possible to see how a particular is formatted for ?

I did a little experimenting, and it seems that if I put in text, or 
numbers, and go to Format Cell, it "seems" to indicate the Format is 
General, for both.

Is there some command that would return an inquiry to a text cell as it 
truly being "Text" ?

And, I understand that text when entered shows up to the left of the 
cell, numbers to the right.  If I change the left-right position with 
the Alignment buttons, does this change the actual Format of the cell ?

Thanks,
Bob
0
rgsros3251 (59)
12/2/2010 5:41:44 PM
excel.newusers 15348 articles. 2 followers. Follow

6 Replies
494 Views

Similar Articles

[PageSpeed] 50

See help on Information Functions, specifically the CELL function which returns
type of format.

Changing alignment does not change format.

Note that a valid Date is a number so ISNUMBER will return TRUE


Gord Dibben     MS Excel MVP

On Thu, 02 Dec 2010 12:41:44 -0500, Bob <rgsros@notme.invalid> wrote:

>ello,
>
>Is it possible to see how a particular is formatted for ?
>
>I did a little experimenting, and it seems that if I put in text, or 
>numbers, and go to Format Cell, it "seems" to indicate the Format is 
>General, for both.
>
>Is there some command that would return an inquiry to a text cell as it 
>truly being "Text" ?
>
>And, I understand that text when entered shows up to the left of the 
>cell, numbers to the right.  If I change the left-right position with 
>the Alignment buttons, does this change the actual Format of the cell ?
>
>Thanks,
>Bob
0
phnorton (279)
12/2/2010 7:46:57 PM
Hi,

Thanks for help.

I guess I should have mentioned that I'm reall dumb with this;
new user, truly.

I looked at where you suggested, and found:

info_type    Required.

A text value that specifies what type of cell information you want to 
return. The following list shows the possible values of the info_type 
argument and the corresponding results.
info_type Returns "address" Reference of the first cell in reference,as 
text.

O.K. I click in the cell that I'm interested in know if it is formatted 
as Text or as a Number.

Now, specifically what do I do next, please ?
What do I type for info_type ?
Where do I type it ?
etc.

Thanks again,
Bob
-------------



On 12/2/2010 2:46 PM, Gord Dibben wrote:
> See help on Information Functions, specifically the CELL function which returns
> type of format.
>
> Changing alignment does not change format.
>
> Note that a valid Date is a number so ISNUMBER will return TRUE
>
>
> Gord Dibben     MS Excel MVP
>
> On Thu, 02 Dec 2010 12:41:44 -0500, Bob<rgsros@notme.invalid>  wrote:
>
>> ello,
>>
>> Is it possible to see how a particular is formatted for ?
>>
>> I did a little experimenting, and it seems that if I put in text, or
>> numbers, and go to Format Cell, it "seems" to indicate the Format is
>> General, for both.
>>
>> Is there some command that would return an inquiry to a text cell as it
>> truly being "Text" ?
>>
>> And, I understand that text when entered shows up to the left of the
>> cell, numbers to the right.  If I change the left-right position with
>> the Alignment buttons, does this change the actual Format of the cell ?
>>
>> Thanks,
>> Bob

0
rgsros3251 (59)
12/3/2010 3:06:22 PM
To find things out about a cell you do not click in that cell.

You select another cell and write a formula referring to the cell in question.

Type your name into A1

In B1 enter  =ISTEXT(A1)

Should return TRUE

In C1 enter  =ISNUMBER(A1)

Should return  FALSE

For info-type you would enter in D1  =CELL("type",A1)

Will return  l  indicating text as in "label"


Gord


On Fri, 03 Dec 2010 10:06:22 -0500, Bob <rgsros@notme.invalid> wrote:

>Hi,
>
>Thanks for help.
>
>I guess I should have mentioned that I'm reall dumb with this;
>new user, truly.
>
>I looked at where you suggested, and found:
>
>info_type    Required.
>
>A text value that specifies what type of cell information you want to 
>return. The following list shows the possible values of the info_type 
>argument and the corresponding results.
>info_type Returns "address" Reference of the first cell in reference,as 
>text.
>
>O.K. I click in the cell that I'm interested in know if it is formatted 
>as Text or as a Number.
>
>Now, specifically what do I do next, please ?
>What do I type for info_type ?
>Where do I type it ?
>etc.
>
>Thanks again,
>Bob
>-------------
>
>
>
>On 12/2/2010 2:46 PM, Gord Dibben wrote:
>> See help on Information Functions, specifically the CELL function which returns
>> type of format.
>>
>> Changing alignment does not change format.
>>
>> Note that a valid Date is a number so ISNUMBER will return TRUE
>>
>>
>> Gord Dibben     MS Excel MVP
>>
>> On Thu, 02 Dec 2010 12:41:44 -0500, Bob<rgsros@notme.invalid>  wrote:
>>
>>> ello,
>>>
>>> Is it possible to see how a particular is formatted for ?
>>>
>>> I did a little experimenting, and it seems that if I put in text, or
>>> numbers, and go to Format Cell, it "seems" to indicate the Format is
>>> General, for both.
>>>
>>> Is there some command that would return an inquiry to a text cell as it
>>> truly being "Text" ?
>>>
>>> And, I understand that text when entered shows up to the left of the
>>> cell, numbers to the right.  If I change the left-right position with
>>> the Alignment buttons, does this change the actual Format of the cell ?
>>>
>>> Thanks,
>>> Bob
0
phnorton (279)
12/3/2010 4:51:36 PM
On Fri, 03 Dec 2010 10:06:22 -0500, Bob <rgsros@notme.invalid> wrote:

>Hi,
>
>Thanks for help.
>
>I guess I should have mentioned that I'm reall dumb with this;
>new user, truly.
>
>I looked at where you suggested, and found:
>
>info_type    Required.
>
>A text value that specifies what type of cell information you want to 
>return. The following list shows the possible values of the info_type 
>argument and the corresponding results.
>info_type Returns "address" Reference of the first cell in reference,as 
>text.
>
>O.K. I click in the cell that I'm interested in know if it is formatted 
>as Text or as a Number.
>
>Now, specifically what do I do next, please ?
>What do I type for info_type ?
>Where do I type it ?
>etc.
>
>Thanks again,
>Bob
>-------------
>

You will need VBA to determine that.

You can use a User Defined Function, but be aware that merely changing
the format will not trigger the formula to recalculate.  If this might
be a problem, there are a variety of solutions, but they depend on
more information about your worksheet.

To enter this User Defined Function (UDF), <alt-F11> opens the Visual
Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.

To use this User Defined Function (UDF), enter a formula like 

	=fmt(A1) 

in some cell.

This will return the same kind of string that you see in the Format
Cells dialog.

So if the cell is formatted as text, the formula will return "@"

You could certainly add to the VBA UDF logic to decode all of this;
again, it depends on how you are going to be using this.

==============================
Option Explicit
Function Fmt(cell As Range) As String
Application.Volatile
    Fmt = cell.NumberFormat
End Function
====================
0
ron6368 (329)
12/3/2010 6:41:26 PM
On Fri, 03 Dec 2010 08:51:36 -0800, Gord Dibben <phnorton@shaw.ca>
wrote:

>For info-type you would enter in D1  =CELL("type",A1)
>
>Will return  l  indicating text as in "label"
>
>
>Gord

If I understand the OP correctly, I think he wants to know whether the
cell is formatted as General or Text.

I believe the "type" parameter will return l regardless of the
formatting of the cell, if it contains "label"
0
ron6368 (329)
12/3/2010 8:49:54 PM
You are correect Ron

Excel does not distinguish between Text or General using any of the CELL
arguments

=CELL("format",A1)  will return  G  if  A1 contains text

ISTEXT would have to employed.

I posted that alternative.


Gord

On Fri, 03 Dec 2010 15:49:54 -0500, Ron Rosenfeld <ron@nospam.net> wrote:

>On Fri, 03 Dec 2010 08:51:36 -0800, Gord Dibben <phnorton@shaw.ca>
>wrote:
>
>>For info-type you would enter in D1  =CELL("type",A1)
>>
>>Will return  l  indicating text as in "label"
>>
>>
>>Gord
>
>If I understand the OP correctly, I think he wants to know whether the
>cell is formatted as General or Text.
>
>I believe the "type" parameter will return l regardless of the
>formatting of the cell, if it contains "label"
0
phnorton (279)
12/3/2010 9:02:49 PM
Reply:

Similar Artilces:

can I find merged cells?
I'm trying to sort and get the message "merged cells must be the same size". How can I 'find' the merged cells? David, here is a macro by Dave Peterson that will do it Sub Found_Merged_Cells() 'macro looks for merged cells 'By Dave Peterson Dim myCell As Range Dim resp As Long For Each myCell In ActiveSheet.UsedRange.Cells If myCell.MergeCells Then If myCell.Address = myCell.MergeArea(1).Address Then resp = MsgBox(prompt:="found: " _ & myCell.MergeArea.Addre...

Tab to specific cells
I am using excel 2002 and my boss 2003. I want to tab to specific cells in my work sheet. Can anyone help me get started? You could try the named range approach. Select your *second* cell for data entry and then hold down <Ctrl> and continue to select all the rest of the desired cells in order, ending with selecting your *first* cell *last*. While the cells are still selected, click in the name box and give this range a short name such as "Entry1". Now, when you're ready for data entry, simply click on the range name in the name box. The focus for the range is th...

Text to speech particular cell
hi ive been trying for a while now to get the text to speech function to work for a particular cell. For example, i have a set of numbers and a total in D15, what i would like is that if i change the numbers that contribute to that total, and the total in D15 changes then excel will alert me saying "Change in Total". ive tried and failed to get it notice the changed total and would really appreciate some help Thank You for any contributions Let's put the message in a cell, say D16. In a standard module insert the follow line: Public OldVar As Variant Insert the following...

Write formula for simple copy and paste to another cell
I have a worksheet that contains hundreds of columns. Each group of three are related to each other (Cols A-C, D-F, etc...). I have this formula that works well for columns A-C =IF(NOT(ISBLANK('Page 5 Counts'!B2)),VLOOKUP('Page 5 Counts'!B2,'Color Key'!$A$1:$B$87,2,FALSE),IF(AND(COLUMN()=COLUMN($B$1),ROW()=1),IF($A$2=$A$1,"",1),IF(AND(COLUMN()=COLUMN($C$1),ROW()=1),$B$1,IF(AND(COLUMN()=COLUMN($B$2),ROW()=2),IF($A$2=$A$1,2,1),IF(AND(COLUMN()=COLUMN($C$2),ROW()=2),IF($A$2=$A$3,"",IF($A$2=$A$1,$B$2,1)),IF(AND(COLUMN()=COLUMN($B$3),ROW()=3),IF($A...

Copying cell contents to a list
First of all - apologies if this is in the wrong group. I wasn't sure if it should be newusers (which I am) or programming (which I might need). I have inherited a lottery syndicate at work after the previous organiser retired. He kept an Excel 97 spreadsheet with 8 columns - A (Date), B to G (Winning numbers) and H (Bonus number). This list has now grown to about 800 rows as each draw's numbers are added to the bottom of the list (I will be removing about 600). I have adapted the spreadsheet to automatically check our numbers against the winning numbers (using HLOOKUP) after I have ...

how to determine eConnect version
Does anyone know a way to determine the exact eConnect version running on a computer? If you go to control panel, it will show you only the mayor version but not the other minor versions. Thank you, Eduardo In Windows, Go to Start > Programs > Microsoft Dynamics > eConnect 10 > Release Information > Release Info. This window will be populated with the exact version of eConnect. Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Global Business, LLC http://www.maximumglobalbusiness.com "Eduardo" wrote: > Does anyone know a way to determine the e...

Table exist
Hi A simple question On a form, I have a button that create a table when someone click on it "DoCmd.open query " But I want to add something that will stop the code if the table already exist Something like If the table exist then msgbox "The table already exist" else DoCmd.open query "...." So what is the right sentence for "if the table exist" thanks You could use for instance the following function: Public Function tableExists(strTableName As String) As Boolean Dim dbClient As Database Dim tdf As TableDef Set dbClient = CurrentDb For Each...

Place X in cell if criteria met`
Is there a formula to do this? If cell B2 = pencils Put an "X" in cell B7 If cell B2 = pens Put an "X" in cell B8 If cell B2 = erasers Put an "X" in cell B9 Thanks in advance in cells B7 put =if(B2="pencils","x","") in Cell B8 put =if(B2="pens","x","") In cell B9 put =if(B2="erasers","x","") "jhicsupt" wrote: > Is there a formula to do this? > > If cell B2 = pencils > Put an "X" in cell B7 > > If cell B2 = pens ...

Help with String.Format
Hello, I have a winforms app with some values in the app.config file I use to create a connection string to excel. Some of the values require quotes around the values within the connection string. Here is an example of the connection string: string connectionString =3D @"Provider=3DMicrosoft.Jet.OLEDB.4.0; Data Source=3DBook1.xls;Extended Properties=3D""Excel 8.0;HDR=3DYES;"""= ; Note the quotes around the Extended Properties values. I have the following String.Format code (which doesn=92t work): sConnStr =3D String.Format( ...

Custom number format with colors
Hi, I would like to format my numbers this way: > 0 --> Green = 0 --> Black < 0 --> Red How can I do that? Thanks!! Go to Format->Conditional Formatting... set your specs and click the format button to format the text the way you want. You will do a seperate one for each color. Select the entire sheet first though (CTL-A) -- -John Please rate when your question is answered to help us and others know what is helpful. "andre.labonte@gmail.com" wrote: > Hi, > > I would like to format my numbers this way: > > > 0 --> Green > = ...

Conditional Formatting and Buttons
Hello, I'm working on a project and I'm stumped at a particular point. I hav an initial page that contains several "option" buttons. What I a trying to accomplish is that upon selecting 1 button from each of the categories(11 possibilities in total) I would like to have them setup s that it will access specific "names" that I have created. Is conditional formatting the appropriate manner to do this? Any comments or suggestions will be greatly appreciated. Thank yo -- Message posted from http://www.ExcelForum.com hi, i am not sure if i understand you corr...

Send Email With Cell Conent as Part of the Subject
Hyperlink is able to send email with cell content in the Subject line. My Case =HYPERLINK("mailto:Collections_Admin?subject=Overdue Balance " & "_"& 'Sheet1'!G15,"Email To Collection Agency") Sheet1G15 has the data I want to show in the subject line. Is it possible to do this with Macros? I am using Lotus Notes for email. Thanks Igbert For lotus code see Sending mail from Lotus Notes (XL-Dennis) http://www.excelkb.com/?cNode=1X5M7A -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "igbe...

Label a button from a cell content
Hello, Using Excel 97, is their a way to aquire the label for a button from cell on a different worksheet? :confused: Thanks in advance, Sp -- spyrul ----------------------------------------------------------------------- spyrule's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2548 View this thread: http://www.excelforum.com/showthread.php?threadid=38935 ...

inserting texts in cell based on conditions
Hi, I would very much appreciate if someone could help me solving a problem, illustrated by the following example: Column A B C 1 1 "LB" 2 1 "DK" 3 4 1 1 "LB/DK" If there's a 1 in column A, the corresponding cell in column C should get the text "LB" inserted into it. If there's a 1 in column C, the corresponding cell in column C should get the text "DK" inserted into it. If both column A and B have ones in them, the corresponding cell should get the...

How do I Add and Subtract percentages in cells
Can anybody help I am trying to add and subtract percentages from cells deducting tax from wages etc. How do i go about it.As i am new to excel Thanks in advance. Ron Ronnie Check out this on-line tutorial for Excel. http://www.usd.edu/trio/tut/excel/index.html Specifically the "Basic Math" section. http://www.usd.edu/trio/tut/excel/13.html Gord Dibben Excel MVP On Sun, 1 Aug 2004 23:06:56 +0100, "Ronnie" <ronnie@broraweb.co.uk> wrote: >Can anybody help I am trying to add and subtract percentages from cells >deducting tax from wages etc. >How do i ...

I want to format a cell based on an adjacent cells value
I would like a cell automatically formatted in the same way a conditional format works - but the format to be based on the value of an adjacent cell. Any ideas as I cant work out how or if I can achieve this Cumbo, Use Conditional Formatting, but change cell valve is to formula is and use something like this, will change the cell if A1=25 =$A$1=25, so if you select B5 and put this in conditional formatting cell B5 will change when A1 = 25 -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on an...

calculation of cells
Periodically I open a work book and the calculation option has been changed to manual and I cannot figure out why. It seems that it would have to be done by a user and most of my spreadsheets are only used by me. Any ideas out there Mark, Calculation, auto or manual, is set by the first workbook that's opened. It is that way for any other workbooks opened in that instance of excel. Look for a workbook you might have opened first that's been set to Manual and saved that way. Go figure. -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------...

Counting cells based on color
I am looking for a "counting" formula that will count cells in a rang based on their color, so that if I color a series of dates (to sho 'vacation) the number of cells (days) will be counted...to keep trac of vacation...thanks -- Message posted from http://www.ExcelForum.com There's no built-in functionality for that - it requires a UDF (user-defined function). You'll find several examples in the google archives: http://www.google.com/advanced_group_search? as_ugroup=*excel*&lr=&num=100&hl=en MVP Chip Pearson also has some code: http://www.cpearson.com...

Multiple IF statements in one cell
Excel 2003 on XP. I have a project control listing that has, in part of it, nine columns that will hold the dates that certain stages are met, i.e. a date will be entered as each stage is met and the following stages will be empty, until Stage 9 - Project Complete/Signed Off. Stages 1-9 each have a unique Stage Name/defintion. I would like a following cell in the row to automatically show the Stage Name for the latest date in the corresponding stage cell for that project. I have a nested IF statement that works but as the project list is to get very large I would like a neater way of doin...

Automating transfer of data in cells
I have a time management spreadsheet with data stored against work type and date. I need to transfer this data into a similar but more comprehensive spreadsheet and wonder whether it is possible to automate this task by using the work types and dates in a macro (I have almost 10 months of data to transfer), along the lines of check date, check worktype, where argument is true enter data from cell. I think I need to use visual basic, but I can't find out how in the help screens. Any advice is much appreciated. This is not difficult providing you keep your data in simple tables...

Cell formats, and time difference
Hi, some simple questions which I hope someone can help with... I am using excel on a computer with "danish locale". This means that numbers are displayed default like 1234,56. How do I change this to a format using a decimal point (instead of a comma)? How do I find the difference between to times? I have cells which just have times (not dates), and I want to find the difference between two times in hours. For example cells with 08:00 and 09:30 should give a difference of 1.5 Excel help gives an example like =TEXT(B2-A2,"h"), but this gives an error... Thanks, Pet...

Skip blank cells in diagrams
How do I exclude blank cells in diagrams. If I have an area of data and among these data some is blank. How do I get excel to not display these data as '0' but just to skip the cell. You can include the function NA() in that field and the zero value for the data won't be displayed. "hlp" <hlp@discussions.microsoft.com> wrote in message news:4FF83D9F-F13E-4815-BDDE-26F44F2E6BE1@microsoft.com... > How do I exclude blank cells in diagrams. If I have an area of data and among > these data some is blank. How do I get excel to not display these data as '0...

Save spreadsheet using cell values as filename
I am trying to use a command button to save a spreadsheet using cell values as the file name from the tab Master. For example I want to use cells B2 (Tony.Dungate) and F2 (2010.March) to create a file name of Tony.Dungate.2010.March.xls. Essentialy I would need something like : Master!B2&.&Master!G2&".xls" Can someone advise me on the correct code to do this. I have been trying to use the following without success: Const sRoot As String = "V:\Database Logs\" With ActiveWorkbook .SaveAs Filename:=sRoot & _ ....

returning vlookup values for blank cells
I have a spreadsheet that lists "soccer players" by name down the first colunm and "time in game" across the top and the position they play in array. I then use vlookup for another spreedsheet by "position" down the first column, time across the top and puts the players name into the positions. All this works fine. Since there are 5 more kids than positions, the orginal spreedsheet has blanks when the kids are out of the game. How do I use vlookup or other to extract the 5 sub'd out kids at the bottom of the 2nd spreadsheet? It only returns the nam...

minimum for casual cells but >0
I have big table with vendors, and I have to find the lowest price for each item, but prices are like: A B C D E F G H I etc. Item x 128 175 0 215 the problem is there are also columns with quantities which shouldn't be included I don't want to include columns e.g. B, D, F etc. AND find minimum price but >0. so I can't use: MIN(C1,E1,G1,I1...) because I'll get 0 as result. I'm looking for the simplest solution. Appreciate for any help. Ctrl/shift/ente...