Home Privacy Policy Feedback Link to us Site Map Forums

Excel: Asc Function (VBA only)


In Excel, the Asc function returns the NUMBER code that represents the specific character.

The syntax for the Asc function is:

Asc( string )

string is the specified character to retrieve the NUMBER code for. If more than one character is entered, the function will return the value for the first character and ignore all of the characters after the first.


Applies To:

  • Excel 2007, Excel 2003, Excel XP, Excel 2000

For example:

Asc ("W") would return 87.
Asc ("Wednesday") would return 87.
Asc ("x") would return 120.

VBA Code

The Asc function can only be used in VBA code. For example:

Dim LResult As Integer

LResult = Asc ("W")

In this example, the variable called LResult would now contain the value 87.