How to use the VBA UCASE Function (Syntax + Example)

HomeVBA Functions LIST (Category Wise)How to use the VBA UCASE Function (Syntax + Example)

The VBA UCASE function is listed under the text category of VBA functions. When you use it in VBA code, it converts the supplied string into an upper case string. In simple words, upper case string is where you have all the characters in capital letters. It works the same as we have the UPPER function in the worksheet.

Syntax

UCase(String)

Arguments

  • String: The string value which you want to convert into upper case.

Example

To practically understand how to use VBA UCASE function, you need to go through the below example where we have written a vba code by using it:

Sub example_UCASE()
Range("B1").Value = UCase(Range("A1"))    
End Sub

In the above code, we have used the UCASE to convert the text from the cell A1 into an upper case text and it has returned it in the cell B1 as EXCEL CHAMPS.

Notes

  • UCASE doesn’t make any changes in punctuation and numbers.

Related Functions

FORMAT | INSTR | INSTRREV | LCASE | LEFT | LEN | LTRIM | MID | REPLACE | RIGHT | RTRIM | SPACE | STRCOMP | STRCONV | STRING | STRREVERSE | TRIM