Removing All Formatting in a Worksheet

Written by Allen Wyatt (last updated September 13, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365


Dennis has a workbook that has been in use in his company for years, and now he's inherited it. Dennis doesn't like the formatting that has been applied in the worksheets, so he wonders if there is a quick way to remove all cell formatting from a worksheet, without affecting cell content, so that he can make the data look decent.

The easiest way to remove all formatting is to follow these steps:

  1. Select all the cells. (You can either press Ctrl+A or click the triangle above the row numbers and to the left of the column letters.)
  2. Display the Home tab of the ribbon.
  3. In the Editing group, click the Clear tool. (It looks like an eraser.) Excel displays some clearing options.
  4. Choose Clear Formats.

When you follow these steps, Excel removes almost all formatting. For instance, it will remove fonts, colors, borders, number formats, conditional formatting, cell merging, etc. It does not change column width, row height, or any formatting applied to individual characters within a cell. (More on how to change these in a moment.)

There is a drawback to using Clear Formats—you will no doubt end up seeing things change that you might not have associated with formatting. For instance, all cells are set back to a General format, which means that all your dates and times may seem to change to numbers. This is because dates and times are displayed using cell formats. Remove the format (as Clear Formats does), and you end up seeing the underlying serial number for the date/time.

If you don't want to get rid of conditional formatting or merged cells, you may get the results you want by following these steps, instead:

  1. Select all the cells.
  2. Display the Home tab of the ribbon.
  3. Click Cell Styles. Excel displays a bunch of different styles you can apply.
  4. Choose Normal.

The other thing that hasn't been addressed when it comes to formatting is hyperlinks. When you use Clear Formats or apply the Normal style, the hyperlinks in a cell remain active, but the formatting used to denote the presence of the hyperlink is removed. Chances are good, though, that if you want to get rid of all formatting, you also want to get rid of the hyperlinks along with their formatting.

The only way to address all of these unwanted formatting changes or formatting you want changed that isn't changed is to use a macro. Here is a good start to a macro that will, in a custom manner, remove formatting from cells in the worksheet:

Sub ClearWorksheetFormatting()
    Dim ws As Worksheet
    Dim c As Range
    Dim sTemp As String

    Set ws = ActiveSheet

    For Each c In ws.UsedRange
        ' Check to see if cell is part of merged area
        If c.MergeCells Then
            c.MergeArea.UnMerge
        End If

        ' Delete any hyperlinks
        c.Hyperlinks.Delete

        ' Clear cell-level formatting if not a date
        If IsDate(c) Then
            sTemp = c.NumberFormat
            c.ClearFormats
            c.NumberFormat = sTemp
        Else
            c.ClearFormats
        End If

        ' Re-enter information to get rid of in-cell formatting
        If Not IsEmpty(c) Then
            If c.HasFormula = True Then
                c = c.Formula
            Else
                c = c.Value
            End If
        End If
    Next c

    ' Reset column widths and row heights
    ws.Cells.ColumnWidth = 8.43   ' default width
    ws.Cells.RowHeight = 15       ' default height
End Sub

The macro steps through each cell in the .UsedRange of a worksheet. It checks if the cell is merged and, if so, undoes the merging. Then it deletes any hyperlinks in the cell and next checks to see if the cell contains a date/time. If it does, then the date formatting is saved, all cell formatting is removed, and the date formatting is reapplied. If the cell does not contain a date/time, then its formatting is simply cleared.

The next step is for the macro to re-enter information in the cell in order to remove any in-cell formatting. (For instance, if part of the text in a cell is bold or italic, but not all of it is.) Finally, the column width and row height of all of the cells is reset to default.

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 (13956) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.

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

Date for Next Wednesday

When working with dates, it is often helpful to be able to calculate some date in the future based on a starting date. ...

Discover More

Viewing Files of a Certain Type

When you choose to open a file, Word normally displays only those files that end with the .DOCX or .DOCM extensions. If ...

Discover More

Adding Smart Quotes through Macro Text

When text is added to your document by a macro, and that text includes quotes or apostrophes, Word won't change the ...

Discover More

Program Successfully in Excel! This guide will provide you with all the information you need to automate any task in Excel and save time and effort. Learn how to extend Excel's functionality with VBA to create solutions not possible with the standard features. Includes latest information for Excel 2024 and Microsoft 365. Check out Mastering Excel VBA Programming today!

More ExcelTips (ribbon)

Flashing Cells

Want to draw attention to some information in a particular cell? Make the cell flash, on and off. Here's how you can ...

Discover More

Changing the Color of a Cell Border

Excel provides a variety of tools you can use to make your data look more presentable on the screen and on a printout. ...

Discover More

Adjusting Cell Margins for More White Space

Is the information in your cells too jammed up? Here are some ways you can add some white space around that information ...

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 6 + 8?

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 ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.