ASCW

ASCW(string)

Returns the Unicode 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" is longer that one character, then the other characters are ignored.
* If "string" = "", then a run-time error occurs.
* The value returned is in the range 0 to 65,535.
* The length of a string in bytes may be greater than or equal to the number of actual characters in the string.
* VBA for Macintosh does not support Unicode Strings.
* You can use the ASC function to return the ASCII / ANSI number for the first character in a text string.
* You can use the ASCB function to return the first byte.
* You can use the CHR function to return the character with the corresponding ASCII / ANSI number.
* You can use the CHRW function to return the character with the corresponding Unicode number.
* The equivalent .NET function is Microsoft.VisualBasic.Strings.Asc
* For more information, refer to the Unicode Characters page.
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print AscW(0)           '= 48  
Debug.Print AscW(1) '= 49
Debug.Print AscW(9) '= 57
Debug.Print AscW("A") '= 65
Debug.Print AscW("Avocados") '= 65
Debug.Print AscW("Z") '= 90
Debug.Print AscW("a") '= 97
Debug.Print AscW("z") '= 122
Debug.Print AscW(12) '= 49
Debug.Print AscW(ChrW(65)) '= 65
Debug.Print AscW(ChrW(2000)) '= 2000

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