Easily Copying Cell Formatting

Written by Allen Wyatt (last updated May 14, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021


Barry is often sent documents with manually applied shading in some of the table rows and he needs to apply the exact shading elsewhere. For other formatting he would probably use the Format Painter but, alas, it only copies the formatting of the text, not of the cell. Barry wonders about the easiest way to copy cell formatting from one place to another.

As far as I've been able to determine, there is no shortcut within Word that allows you to copy table cell formatting from one cell to another. You can, if you want, use the tried and true "repeat the last action" technique:

  1. Select the cell you want to format.
  2. Apply formatting to the cell.
  3. Select one or more other cells.
  4. Press F4.

This works because pressing F4 repeats the previous action you took in the document. Since the previous action was to apply some formatting to a cell (step 2), pressing F4 applies that same formatting to the other cells you selected in step 3.

This can get a bit tedious, though. A better way might be to create a macro to copy the formatting. Since Barry is dealing specifically with cell shading, I'll provide a macro that focuses just on that. Actually, there are two macros here:

Dim lbgc As Long

Sub SetColor()
    If Selection.Information(wdWithInTable) Then
        lbgc = Selection.Cells(1).Shading.BackgroundPatternColor
    Else
        MsgBox "Insertion point is not in a table."
    End If
End Sub
Sub ApplyColor()
    Dim c As Cell

    If Selection.Information(wdWithInTable) Then
        For Each c In Selection.Cells
            c.Shading.BackgroundPatternColor = lbgc
        Next c
    End If
End Sub

Note several things about these macros. First, you can see that a variable (lbgc) is defined outside of any of the macros. This is because the variable is used in both the SetColor and ApplyColor macros.

The SetColor macro is used to specify the background color you want to paste elsewhere. All you need to do is to place the insertion point within a table cell and then run the macro. It takes the background color and places it in the lbgc variable. If you select multiple cells before you run the macro, then it only uses the background color from the first cell in your selection.

Now you can select any other cells you want and run the ApplyColor macro. It takes the value stored in lbgc and applies it to the background in every cell you selected.

If you assign shortcut keys to these macros (or add them to your Quick Access Toolbar), then you can easily copy background shading from one cell to any number of other cells you desire.

As I said, these macros deal only with background color because that was the issue being faced by Barry. There are other table cell formatting elements that could be saved and copied using the same technique—just define the storage variables outside of the macros, save the values in the SetColor macro, and then apply the values in the ApplyColor macro.

Note:

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

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12881) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021.

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

Automatically Saving Changes to Defaults

Have you ever started a new document only to find that the settings in Word seem to be different than what you expected? ...

Discover More

Changing Tabs Using the Ruler

Need to adjust the position of tab stops in a paragraph? One simple way to do it is to just drag them around on the ruler.

Discover More

Adding Quotes

Adding quote marks is normally as simple as typing them from the keyboard. However, if you want to add quote marks around ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Underlining Cells, Not Space Between Cells

Word provides a couple of ways you can underline information, including underlining table cells and their contents. ...

Discover More

AutoFitting Tables

Need to adjust the width of a bunch of table columns according to what is in the columns? Word provides a tool to do ...

Discover More

Last-Row Border Formatting

When the last row displayed on a page doesn't show the borders you want, it can be confusing to figure out how to get ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, 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 nine minus 5?

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

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, 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.