Referencing External Cell Colors

Written by Allen Wyatt (last updated November 30, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


Beth asked how to copy the color formatting of an external cell to a cell in the current workbook. Unfortunately, there is no intrinsic way to do this by using the linking features of Excel. You can, however, copy formatting from one workbook to another by using a macro.

As an example, consider the following macro code:

Workbooks.Open Filename:= "C:\mypath\myworkbook.xls"
Range("A1").Select
Selection.Copy
Windows("TargetBook.xls").Activate
Range("C7").Select
Selection.PasteSpecial Paste:=xlPasteFormats, _
  Operation:=xlNone, SkipBlanks:=False, _
  Transpose:=False

This code does several things. First, it opens the external workbook and selects the range of cells you want to copy. The Copy method is then invoked, so the source range is now in the Clipboard. The macro then switches to the target workbook and select the range there. Finally, the PasteSpecial method is used to paste only the format of the source cells.

If you decide to use code like this, you can place it in the Auto_Open macro for the target workbook. Of course, you need to modify the code so that it refers to the proper path and workbook names, along with the desired source and target ranges.

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 (2601) 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

Printing Row Numbers

On-screen Excel displays row numbers that help you easily see what is in each row. If you want to print these row ...

Discover More

Working in Feet and Inches

Your chosen occupation may require that you work with linear distances in feet and inches. Excel can do this, to a ...

Discover More

Multiple References to an Endnote

Adding endnotes in a document is easy in Word. If you want to create multiple references to a single endnote, you can do ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Using Custom Number Formats

Most formatting needs are met by using the predefined formatting options in Excel. The program also allows you to move ...

Discover More

Better Use of Heading Space

If your column headings are too large to work well in your worksheet, why not turn them a bit? Here's how.

Discover More

Adjusting Row Height for Your Text

Want Excel to automatically adjust the height of a worksheet row when it wraps text within the cell? It's easy to do, ...

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 two less than 3?

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.