Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company.
Learn more about Allen...
If you use worksheets that have quite a bit of text in them, there may be times you long for a function like Word has that easily converts between upper and lower case. Excel contains such functions, but they are designed to be used in macros, not as commands from the menus.
If you want to quickly convert large ranges of text without the need to retype the text in the cells of the range, you can use the following macro:
Sub MakeUpper() Dim MyText As String Dim MyRange As Range Dim CellCount As Integer Set MyRange = ActiveSheet.Range(ActiveWindow.Selection.Address) For CellCount = 1 To MyRange.Cells.Count If Not MyRange.Cells(CellCount).HasFormula Then MyText = MyRange.Cells(CellCount).Value MyRange.Cells(CellCount).Value = UCase(MyText) End If Next CellCount End Sub
This macro steps through the cells in a range you select, converts the contents of any cell that does not contain a formula to uppercase. You can easily modify the macro so that it converts to lowercase by changing the UCase function (used near the bottom of the macro) to LCase. Another nifty modification is if you want to use title case instead of uppercase or lowercase. (Title case is where only the first letter of each word is uppercased.) To do this, replace UCase(MyText) with Application.Proper(MyText).
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (1970) applies to Microsoft Excel 97, 2000, 2002, and 2003.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!