Thursday, March 17, 2011

How to Make Everything Uppercase in Excel


1. Open the Excel worksheet.
2. Press Alt and F11 to bring up the Excel 2010 VBA console. Once the console opens, find the name of your workbook on the list on the left side of the screen. Right-click the workbook name, move your mouse over 'Insert' and select 'Module.' Double-click the module that appears.
3. Click anywhere in the blank white space on the right side of the VBA console. Type in the following: 'Sub UpperCaseConvert()' and press Enter. VBA will automatically insert the 'End sub' command at the bottom of the code.
4. Type 'Dim x As Range' into the line directly beneath the 'Sub' line. This will create a variable, 'x,' that you will need later in the VBA code. Press Enter to access the next line.
5. Enter the following code into the VBA console:For Each x In Cells.SpecialCells(xlConstants, xlTextValues)x.Formula = UCase(x.Formula)NextThis will go one-by-one through every cell that contains text on your worksheet and convert it to uppercase. Click the 'X' in the top-right corner of the VBA console to close it.
6. Click the 'Developer' tab at the top of the Excel screen. Click the 'Macro' button, which is located in the 'Code' area of the ribbon. Select 'UpperCaseConvert' from the list of macros and click 'Run.'

Blogger news