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

 

CODE(text)

 
 Returns the ANSI number for the first character in a text string.

 textThe text string you want the first character code for.

 REMARKS
 
  • The ANSI number corresponding to a character is the inverse of the CHAR() function.
     
  • The "text" can be a text string, a cell reference or a named range.
     
  • If "text" contains more than one character, then the first character is used.
     
  • For a full list of all the ASCII String Codes, please refer to the String Table page.

     EXAMPLES
     
     A
    1=CODE("A") = 65
    2=CODE("F") = 70
    3=CODE("a") = 97
    4=CODE("b") = 98
    5=CODE("Alphabet") = 65
    6=CODE(-1) = 45
    7=CODE(CHAR(23)) = 23
    8=CODE("some text") = 115
    9=CODE("") = #VALUE!
     

     Functions - C | Index - C | Text Manipulation | Office Online 

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