+ Reply to Thread
Results 1 to 3 of 3

Replace sheet in workbook with new sheet without #REF formula errors

  1. #1
    Registered User
    Join Date
    02-07-2020
    Location
    los angeles
    MS-Off Ver
    Office Professional
    Posts
    7

    Replace sheet in workbook with new sheet without #REF formula errors

    Hello everyone,

    whenever I have a workbook that pulls info from multiple worksheets, if I have to replace one of the worksheets with an updated version and name the sheet with the same name as the older sheet, and then delete or change the name of the older sheet, all the formulas that were referencing the older sheet instead reference #REF.

    Is there anyway to keep all the formula references the same, and simply swap out the sheets and delete the old sheet without this error?

    Thanks in advance.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Replace sheet in workbook with new sheet without #REF formula errors

    No, you can't swap out sheets like that. Consider keeping all sheets and just pasting new data into existing sheets.

    Or, keep the sheets with the data in a different workbook than the sheet with the formulas. Close the workbook with the formulas, then swap out and rename the sheets, and re-open the workbook with the formulas. As long as the formula workbook is closed, it will not detect that you deleted and renamed any sheets and the formulas will find the sheets.

  3. #3
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Replace sheet in workbook with new sheet without #REF formula errors

    Quote Originally Posted by ExcelNewbie2020 View Post
    . . . Is there anyway to keep all the formula references the same, and simply swap out the sheets and delete the old sheet without this error? . . .
    Not directly. However, if the replacement worksheet would have exactly the same layout (cell formatting, row heights, column widths, data locations by cell) as the original worksheet, you should be able to copy all cells in the replacement worksheet and paste into the original worksheet. Or clear contents of all cells in the original first, then paste in everything from the replacement worksheet.

    Alternatively, if the original worksheet to be replaced were named MyWorksheet, you could add the new worksheet either immediately before or immediately after it, rename MyWorksheet as Replace_Me, and rename the new worksheet as MyWorksheet. At this point formulas in other worksheets would refer to Replace_Me instead of MyWorksheet.

    Press [Ctrl]+H to display the Find and Replace dialog, replace all instances of Replace_Me! with MyWorksheet! in all cell formulas. Note: if your actual worksheet names require single quote delimiters, include them in this operation. This should change all formulas in other worksheets to refer to the replacement worksheet, and no formulas should refer to Replace_Me. Now delete the Replace_Me worksheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy a sheet from a workbook to another one and replace the same sheet already exits
    By billj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-13-2020, 06:05 AM
  2. VBA to find and replace from separate workbook / sheet
    By Bowler112 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2018, 02:48 PM
  3. [SOLVED] How to replace a sheet that has formulas linked to it, without REF-errors?
    By birbjo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-21-2014, 08:09 PM
  4. [SOLVED] #REF! Errors after copying formula to new sheet
    By Big.Moe in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-30-2013, 11:11 PM
  5. Replace a sheet from a workbook in multiple workbooks using VBA
    By aminewehbe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2013, 03:47 PM
  6. [SOLVED] Find and Replace Macro- Within Workbook or Sheet
    By Rhudi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2013, 12:53 PM
  7. Replies: 1
    Last Post: 03-01-2011, 03:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1