Function Character Types Class

ToUpper

"To Upper Case" Convert a character or a string to its upper-case equivalent; non-alphabetic characters remain unchanged.

Signature (Visual Basic / VBA)

Public Function ToUpper( _
    ByVal vValue As Variant _
    ) As Variant

Code Example

    ToUpper("ABC abc 123 !@#") = "ABC ABC 123 !@#"
    ToUpper(Asc("a")) = ToUpper(97) = Asc("A") = 65
    ToUpper(Asc("A")) = ToUpper(65) = Asc("A") = 65

Parameters

Parameter Description
vValue The character or string which is to be converted to "upper-case." Note: Special argument fix-up code. If vValue is numeric (and not a numeric string), then function returns the ASCII value of the upper-case equivalent of the character with ASCII value vValue. If vValue is a string, then function uses the Visual Basic UCase() function to convert it to lower-case.

Notes & Version History

Note Function only works for characters in the ANSI Windows character set because it uses the built-in Visual Basic UCase$() function.