+ Reply to Thread
Results 1 to 6 of 6

Replace External Links with Values inside Formulas

  1. #1
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Replace External Links with Values inside Formulas

    Hello,

    I have a workbook with multiple sheets. Many of the cells have formulas like "=I3*[Other Book]Sheet1!H5+I4*[Dif Book]!Sheet2!D4+J3". Assuming that [Other Book]Sheet1!H5 = 3 and [Dif Book]!Sheet2!D4 = 2, I would like to make a macro that changes this to "=I3*3+I4*2+J3". It can be manually done by highlighting the external parts of the formula one by one and hitting F9, then saving the formula, but this would take forever.
    1. Include a sample workbook with an example of the result you want
    2. Use [CODE] and [FORMULA] wrappers for your VBA code or excel formulas
    3. If your question has been answered, mark the thread as SOLVED and click on the "Add Rep" star to thank whoever helped you.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace External Links with Values inside Formulas

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 04-21-2015 at 11:31 AM.

  3. #3
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Replace External Links with Values inside Formulas

    Thanks JOHN H. DAVIS. That gives me a great idea. I'm going to try modifying your code to open all the workbooks listed in the LinkSources and then find and replace their formulas with the appropriate values. It might be tricky because I have to match anything of the form [WB Name]SheetName!LETTER#, but I'll see how it goes.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace External Links with Values inside Formulas

    You're welcome. Hope it works out for you.

  5. #5
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Replace External Links with Values inside Formulas

    I'm currently stuck on how to evaluate part of a regex expression. I want to use the pattern matches to reference an external workbook and pull the value. Do you know how to do that. Here is my current code, which is a mess since I'm in the middle of writing it:

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Replace External Links with Values inside Formulas

    I finally figured it out. My code is below, for posterity. It goes through and replaces any single-cell external reference in a formula with the appropriate value. It then breaks the connection, so that any cell containing an external range gets converted to a value.

    Please Login or Register  to view this content.

+ 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. How to remove external links from formulas
    By Thomas Andrews in forum Excel General
    Replies: 2
    Last Post: 06-10-2014, 03:38 AM
  2. Problems with Formulas Referencing External Links
    By bcsbrown in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-18-2014, 12:35 PM
  3. [SOLVED] Find and Replace for Inside Formulas
    By VICEROY in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2013, 01:03 AM
  4. [SOLVED] External Links Not Updating when inside COUNTIFS
    By sunsoar77 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-19-2012, 12:20 AM
  5. [SOLVED] How to past formulas without updating external links
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-04-2005, 08:05 AM

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