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:
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:
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.
Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!
You can spend considerable time getting the tables in your document to look just right. What happens, though, when you ...
Discover MoreWord provides a couple of ways you can underline information, including underlining table cells and their contents. ...
Discover MoreWhen working with tables, you can adjust the height of individual rows. How you go about such adjustments depends on the ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, 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 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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments