VBA UCASE Function (Syntax + Example)

Last Updated: June 22, 2023
puneet-gogia-excel-champs

- Written by Puneet

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, an 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 the VBA UCASE function, you need to go through the below example where we have written a vba code by using it:

example-vba-ucase-function
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 cell A1 into an upper case text and it has returned it in cell B1 as EXCEL CHAMPS.

Notes

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