ASC(string)

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


stringThe text string (String).

REMARKS
* The "string" can be any valid string expression.
* If string = "", then a run-time error occurs.
* The value returned is in the range 0 to 255.
* The length of a string in bytes may be greater than or equal to the number of actual characters in the string.
* Use Asc("y") = x rather than Chr(y) = x
* Use IsCharAlphaNumeric instead of Asc() ?
* The value returned is in the range -32768 - 32767 for Double Byte Character Sets.
* VBA for Macintosh does not support Unicode Strings.
* You can use the CHR function to return the character with the corresponding ANSI number.
* You can use the ASCB function to return the first byte.
* You can use the ASCW function to return Unicode number for the first character in a text string.
* The equivalent .NET function is Microsoft.VisualBasic.Strings.Asc
* For the Microsoft documentation refer to docs.microsoft.com

Asc(0) = 48 
Asc(1) = 49
Asc(9) = 57
Asc("A") = 65
Asc("Z") = 90
Asc("a") = 97
Asc("z") = 122
Asc("Avocados") = 65
Asc(12) = 49

© 2018 Better Solutions Limited. All Rights Reserved. © 2018 Better Solutions Limited Top