UCase, UCase$ Functions

See Also1CIX3IJ              ExampleE24IQ3>Low

Returns a string in which all letters of an argument have been converted to uppercase.




UCase returns a Variant8PHEAW3; UCase$ returns a String.

The argument stringexpr can be any string expression1330R89.  However, only UCase can accept a Variant of VarType7A68ZTZ 1 (Null1DDW7C0) as stringexpr, in which case, a Null is returned.

Only lowercase letters are converted to uppercase; all uppercase letters and nonletter characters remain unchanged.

See Also

LCase, LCase$ Function3M5EGD

Asc FunctionLANASC

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