Converting Text Case

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:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (1970) applies to Microsoft Excel 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

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

MORE FROM ALLEN

Mixed Page Number Formats in a TOC

When you create a Table of Contents for a document that contains multiple sections, the page numbers in that TOC should ...

Discover More

Counting Cells According to Case

Text placed in cells can either be lowercase, uppercase, or a mixture of the two. If you want to count the cells based ...

Discover More

Turning Off Overlapping, by Default

Do you like your text boxes to overlap each other or not. (Word allows both approaches.) This tip provides a couple of ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (menu)

Spreading Out a Table

If someone sends you a worksheet that has lots of data in it, you might want to "spread out" the data so you can have ...

Discover More

Unprotecting Groups of Worksheets

Unprotecting a single worksheet is relatively easy. Unprotecting a whole lot of worksheets is harder. Here's how you can ...

Discover More

Positioning a Column on the Screen

If you have static columns and dynamic columns on the screen, you may want the dynamic columns to always show a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.