ASC Function (VBA)In Microsoft Excel, the ASC function returns the ASCII value of a character or the first character in a string.
SyntaxThe syntax for the ASC function is: Asc( string )
string is the specified character to retrieve the ASCII value for. If there is more than one character, the function will return the ASCII value for the first character and ignore all of the characters after the first.
VBA Function ExampleHere are some examples of what the ASC function would return:
Asc ("W") would return 87
Asc ("Wednesday") would return 87
Asc ("x") would return 120
Dim iResult As Integer iResult = Asc ("W")
In this example, the variable called iResult would now contain the value 87.