Excel VBA Convert Selected Text To Uppercase

Excel VBA All Caps

Microsoft ExcelOne 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.

  1. 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.
  2. If you created or recorded the macro, you will copy & paste the code between “Sub ToUpperCase()” and “End Sub”.
  3. If you went right into Visual Studio, then copy & paste the entire code block, listed below.
Once complete, close Visual Studio, select the cells you want to convert to all Uppercase, and invoke or run the Macro.

 

Share:

1 thought on “Excel VBA Convert Selected Text To Uppercase”

  1. I know this sounds stupid but the reports I complete for the administration is for the seeing impaired and they love everything all uppercase. This script is wonderful. I am now following your blog.

Leave a Reply

Your email address will not be published. Required fields are marked *