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

Find and Replace in Text Boxes

Find and Replace can work great, but not necessarily for text within text boxes. This tip discusses all the ins and outs ...

Discover More

Quickly Inserting the Date Your Way

Tired of messing with inserting the date and then changing it to a format that is more to your liking? There's a quick ...

Discover More

Converting Phone Numbers

Sometimes you receive a phone number that contains alphabetic characters and you need to convert it to a purely numeric ...

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)

Indenting a Table

Insert a table into your document and it normally appears aligned with the left margin. Word allows you to indent the ...

Discover More

Distributing Table Rows Evenly

If you've adjusted the height of your table and the rows within the table, you might want to later return all those rows ...

Discover More

Applying Consistent Shading to a Table

Formatting tables can be very time consuming. When you get a document from another person, you can spend a lot of time ...

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 four less than 7?

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.