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.
- String: The string value which you want to convert into upper case.
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:
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.
- UCASE doesn’t make any changes in punctuation and numbers.