Written by Allen Wyatt (last updated July 29, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003
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).
Note:
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!
Ever want to know how many cells in a worksheet (or a selection) are shaded in some way? You can create a handy little ...
Discover MoreAs your macro processes information in a worksheet, you may want to make sure that it skips over rows that are hidden. ...
Discover MoreDoes your macro need to allow the user to specify a particular file name that should be used by the macro? Here's a quick ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments