See Also Example
Returns a string in which all letters of an argument have been converted to uppercase.
Syntax
UCase[$](stringexpr)
Remarks
UCase returns a Variant
The argument stringexpr can be any string expression However, only UCase can accept a Variant of VarType 1 (Null ) as stringexpr, in which case, a Null is returned.
Only lowercase letters are converted to uppercase; all uppercase letters and nonletter characters remain unchanged.
LCase, LCase$ Function
Asc Function
UCase, UCase$ Function Example
The example uses UCase to return an all-uppercase version of the argument string. To try this example, paste the code into the Declarations section of a form. Then press F5 and click the form.
Sub Form_Click ()
Dim Lowercase, Msg, Uppercase ' Declare variables.
Lowercase = "once upon a time" ' String to convert.
Uppercase = UCase(Lowercase) ' Convert to uppercase.
Msg = "UCase converts """ & Lowercase & """ to """
Msg = Msg & Uppercase & "."""
MsgBox Msg ' Display message.
End Sub