There is a similar function in that also does the same – the UCase function. The VBA UCase function takes a string as the input and converts all the lower case characters into upper case.

Syntax of the VBA UCASE Function

Below is the syntax of the VBA UCase function ‘String’ is the text in which you want to convert all the lowercase to uppercase. You can use a text string, a range reference that contains the text string, or a variable that has the text string. Let’s have a look at a couple of example of using the UCase function in Excel VBA.

VBA UCase Examples

The below code would convert the specified text into uppercase and then display a message box with this text.  

Below is another example VBA code, where I have used a variable (‘Var’) to hold the text string. The UCase function is then used to convert it the lower case characters into uppercase. Another example below shows how to take the string from a cell (A1) and show the uppercase text of it in a message box. While all these above examples work, you’re unlikely to use this function to simply convert or show the uppercase string. Below is a more practical example of the UCase function in Excel VBA. The below code would go through all the cells in the selected range and convert all the text strings into upper case.

Here are a few important things to know about the VBA UCase function: Other Useful Excel VBA Functions:

VBA LCase Function. VBA TRIM Function. VBA INSTR Function. VBA SPLIT FUNCTION.