One of the issues I have run into during my career, is that when dumping data into Excel for reports, the format of the text is different from each data source. This includes all lowercase, all uppercase, and even sometimes random capitalization. Many times I choose to deliver data in all caps, which is uniform, and even easier to read on paper and on screen.
I created the below code to convert a selected range of cells to all Uppercase.
- Create / Record a Macro named “ToUppercase”. Alternatively, you can just go right into the “Developer” tab, and select “Visual Basic” or hit “Alt+F11” to open the Visual Basic Editor.
- If you created or recorded the macro, you will copy & paste the code between “Sub ToUpperCase()” and “End Sub”.
- If you went right into Visual Studio, then copy & paste the entire code block, listed below.
Application.ScreenUpdating = False
Dim cell As Range
For Each cell In Range("$A$1:" & Range("$A$1").SpecialCells(xlLastCell).Address)
If Len(cell) > 0 Then cell = UCase(cell)
Application.ScreenUpdating = True