VBA Asc function

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...

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.

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.

Other notes

The Asc function can be inverted back using the VBA Chr function.

Example usage

Below are some common Asc function VBA examples.

Asc(")")
'Result: 41

Asc("m")
'Result: 109

Simply the best place to learn VBA!

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match