VBA Asc function

Asc Function Description

The VBA Asc function returns an Integer value of the character code corresponding to the provided character. The Asc function can be useful to identify the value of a character in VBA. The full list of ASCII character codes can be found here below.

Syntax

The syntax for the Asc function in VBA is:

Asc( string )

Parameters

string
A single character for which the ASCII value is to be returned. This function ignores any characters aside from the first provided character in the string.

Excel ASCII Character Map

Below is a mapping of Excel Characters to their ascii values:
excel character map

Other notes

The Asc function can be inverted back to a Characterusing the VBA Chr function.

Example usage

Below are some common Asc function VBA examples.

Asc(")")
'Result: 41

Asc("m")
'Result: 109