Loading
Excel.Tips.Net ExcelTips (Menu Interface)

Updating Links in Copied Files

Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Updating Links in Copied Files.

Let's say you have two workbooks that you use for tracking sales in the current month, 2011NovemberA.xls and 2011NovemberB.xls, and that 2011NovemberA.xls contains links to data in 2011NovemberB.xls. When it comes time to copy the workbooks for the new month, you may be wondering about the best way to update all the links in the first workbook so they point to the second workbook for the new month.

To prepare workbooks for the new month, most people will open a Windows folder and copy the workbook files within Windows, not even in Excel. This, however, is the way to guarantee that you do the most work in updating the files. A simpler way is to bypass Windows and do the saving in Excel. Follow these general steps:

  1. Open both 2011NovemberA.xls and 2011NovemberB.xls in Excel.
  2. Use Save As to save the 2011NovemberB.xls file under the name 2011DecemberB.xls.
  3. Use Save As to save the 2011Novemberxls file under the name 2011DecemberA.xls.

As part of saving out 2011DecemberB.xls (step 2), Excel automatically updates all the links in 2011NovemberA.xls so that they point to the new file name. When you then save 2011DecemberA.xls (step 3), you complete the cycle and end up with the new workbooks for the new month, with the past month's files still secure on disk.

If saving the files under new names in Excel is not possible for some reason (perhaps someone else already made a copy of the workbook for the new month and made changes in the file) then you will need to resort to doing some manual editing of the links. Fortunately you can use the Find and Replace features of Excel to help in this task:

  1. Open the 2011DecemberA.xls file.
  2. Press Ctrl+H to display the Replace tab of the Find and Replace dialog box. (See Figure 1.)
  3. Figure 1. The Find and Replace dialog box.

  4. In the Find What box, enter the root portion of the old worksheet name (2011NovemberB).
  5. In the Replace With box, enter the root portion of the new worksheet name (2011DecemberB).
  6. Click Replace All.

Excel goes through the entire worksheet—including the links—and makes changes to the appropriate text.

Another approach is to deal with your monthly files as a whole. In other words, don't have the filenames reflect the month, but put all the workbooks for the month in a single folder that is named after the month. Under this scenario, you could have a November folder, and then make a copy of the whole folder and name it December. You would then have duplicate copies of the workbooks in separate folders. You could work with them independently, as long as you don't try to open the same workbook from both months at the same time. (Excel won't allow you to open multiple workbooks with the same name.)

If you want to make your linking strategy more flexible, you can always use the INDIRECT function. For instance, suppose that your link is something like this:

=[2011NovemberB.xls]Sheet1!B3

You could put the name of the source file (2011NovemberB.xls) in a cell in the current worksheet (D5, for example) and replace the above expression with one like this:

=INDIRECT("[" & D5 & "]Sheet1!B3")

Changing the contents of cell D5 to a different filename will make that file the new source of data. There are a couple of "gottchas," however. First of all, you need to manually open the file that is the target of the link; Excel won't do it for you as it would with a regular link. Also, workbook filenames that contain spaces will trip up the INDIRECT formula. If you think you might have spaces in your filenames, you should change the formula to this:

=INDIRECT("['" & D5 & "']Sheet1!B3")

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3447) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Updating Links in Copied Files.

Related Tips:

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!

 

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 5+3 (To prevent automated submissions and spam.)
 
 
           Commenting Terms

Comments for this tip:

Raaj Chauhan    31 Jul 2015, 12:49
Sir, I have tried with this INDIRECT formula, but it is not working. Sir if possible can you share me any example files, so that it can make my work free and I can save lot of time
Fran    28 Nov 2011, 09:56
I had to make an adjustment to the above INDIRECT formula (for spaces) in order to make the thing work w/o a REF error.

The single quotes had to be moved as:
=INDIRECT("'[" & D5 & "]Sheet1'!b3)

Is this a unique issue w/ my Excel?
R Jayaraman    28 Nov 2011, 04:42
One more option is the Edit Links option under Data tab with 2011DecemberA.xls open. You can then use the Change Source button to replace the old source (2011NovemberB.xls) with new source (2011DecemberB.xls).
Chuck    28 Oct 2011, 11:37
This just save me a ton of time at work. I had been relinking our budget files one by one. Thanks!
 
 

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.