Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions > Information > CELL

 

CELL(info_type [,reference])

 
 Returns a number or text string giving information about a cell.

 info_type The text string indicating the type of information to return:
"address" = address of the cell
"col" = column number of the cell
"color" = 1 if cell is formatted to a particular colour and 0 if not
"contents" = contents of the cell
"filename" = filename and full folder path of the workbook
"format" = number format of the cell
"parentheses" = 1 if the cell is formatted with parentheses for positive or all values and 0 if not
"prefix" = label prefix of the cell
"protect" = 1 if the cell is locked, and 0 if not
"row" = row number of the cell
"type" = type of the data in the cell
"width" = column width of the cell rounded up/down ? to an integer
 referenceThe range of cells that you want information about.

 REMARKS
 
  • This function is volatile and will change everytime a cell on the worksheet is calculated.
     
  • This function will update when the workbook is recalculated by pressing F9.
     
  • The information returned is related to the contents, location or formatting of a given cell.
     
  • If "info_type" = "format", you must recalculate this functions if the cell has a custom format applied afterwards.
     
  • If "reference" is a range of cells, then the upper left cell is used.
     
  • If "reference" is left blank then the last cell that was changed in the active workbook is used.
     
  • This function is provided for compatibility with other spreadsheet programs.

     EXAMPLES
     
     ABC
    1=CELL("address",B1) = $B$15 
    2=CELL("address",B1:B4) = $B$110 
    3=CELL("col",B3) = 215 
    4=CELL("color",B2) = 020 
    5=CELL("contents",B1) = 5some text 
    6=CELL("filename",C2) = C:\Temp\[Book1.xls]Sheet1  
    7=CELL("format",B2) = F0  
    8=CELL("parentheses",B4) = 0  
    9=CELL("prefix",B5) = ' Left aligned text
    10=CELL("prefix",B5) = '' Right aligned text
    11=CELL("prefix",B5) = ^ Centre aligned text
    12=CELL("prefix",B5) = \ Fill aligned text
    13=CELL("prefix",B5) =  Blank when anything else
    14=CELL("protect",B5) = 1 Cell is not locked
    15=CELL("protect",B8) = 0 Cell is locked
    16=CELL("row",B4) = 4  
    17=CELL("type",B2) = v Value
    18=CELL("type",B5) = l Label / Text
    19=CELL("type",B6) = b Empty Cell
    20=CELL("type",A19) = l Function
    21=CELL("width",B4) = 52  
    22=CELL("format",B3) = G General
    23=CELL("format",B3) = F0 0
    24=CELL("format",B3) = ,0 #,##0
    25=CELL("format",B3) = F2 0.00
    26=CELL("format",B3) = ,2 #,##0.00
    27=CELL("format",B3) = C0 £#,##0_);(£#,##0)
    28=CELL("format",B3) = C0- £#,##0_);[Red](£#,##0)
    29=CELL("format",B3) = C2 £#,##0.00_);(£#,##0.00)
    30=CELL("format",B3) = C2- £#,##0.00_);[Red](£#,##0.00)
    31=CELL("format",B3) = P0 0%
    32=CELL("format",B3) = P2 0.00%
    33=CELL("format",B3) = S2 0.00E+00
    34=CELL("format",B3) = G # ?/?
    35=CELL("format",B3) = G # ??/??
    36=CELL("format",B3) = D4 m/d/yy
    37=CELL("format",B3) = D4 m/d/yy h:mm
    38=CELL("format",B3) = D4 mm/dd/yy
    39=CELL("format",B3) = D1 d-mmm-yy
    40=CELL("format",B3) = D1 dd-mmm-yy
    41=CELL("format",B3) = D2 d-mmm
    42=CELL("format",B3) = D2 dd-mmm
    43=CELL("format",B3) = D3 mm/dd/yy
    44=CELL("format",B3) = D5 mm/dd
    45=CELL("format",B3) = D7 h:mm AM/PM
    46=CELL("format",B3) = D6 h:mm:ss AM/PM
    47=CELL("format",B3) = D9 h:mm
    48=CELL("format",B3) = D8 h:mm:ss
     

     Functions - C | Index - C | Office Online 

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.Top