+ Reply to Thread
Results 1 to 7 of 7

Refer to specific cell in external file

  1. #1
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Refer to specific cell in external file

    Hi all,

    I need to combine data from several files together, though, only from specific cells within these files. I already determined which cells are relevant in each file and created below list. I tried using an INDEX formula and just have the link refer to the whole range, then return the correct row, unfortunately the other files are huge and selecting a large range makes the file unresponsive and crash, so I want it to refer to the correct cell directly.

    instead of:

    Please Login or Register  to view this content.
    I want it to be:

    Please Login or Register  to view this content.
    INDIRECT does not seem to work with external links... is there any other way to do it? or would I need VBA?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Refer to specific cell in external file

    INDIRECT works, but the external file must be open.

    One way to do this with VBA (if you do not want to have to open the external file) is to use VBA to build your "want it to be" formula.

    I have implemented the code in your file, and exercised on the rows where you have formulas. But since I don't have your other file I can't test it.

    Whenever a value in column C or column D changes, the formula in F is updated.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: Refer to specific cell in external file

    This is awesome!! Thank you! works very well.

    However, my file has some heavy calculations, hence a "Worksheet_Change" code will trigger quite some lag due to recalculating.
    Is there also a way to re-write the code to have it run once when a button is clicked and then pasting it as values after?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Refer to specific cell in external file

    Another option may be to install the Morefunc add-in which allows using INDIRECT on closed workbooks...
    http://www.ashishmathur.com/tag/morefunc/
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: Refer to specific cell in external file

    Interesting approach! Thanks for sharing FDibbins! Unfortunately there's about 50 people using that file on different computers with different Excel version, so probably not feasible in this particular case

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Refer to specific cell in external file

    As long as you got where you wanted to be, and thanks for the feedback

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Refer to specific cell in external file

    Quote Originally Posted by esbencito View Post
    However, my file has some heavy calculations, hence a "Worksheet_Change" code will trigger quite some lag due to recalculating.
    Is there also a way to re-write the code to have it run once when a button is clicked and then pasting it as values after?
    Yes but it won't make it any faster. The recalculating is triggered by adding the formula. By then the lag will have occurred and nothing will be saved by converting the formula to a value.

    One other option is to have the code open the other file, copy the value, then paste it in.

    The only other option I can think of (without using add-ins) is for the code to use ADO to read the other file without opening it, which treats it like a database.

    ETA: Function INDIRECT.EXT from the Morefunc package does one of those two things but I'm not sure which.

    Bear in mind that with the formula approach I provided, the value will always match the value in the external file. These other two options (plus your suggestion) create a static value, and if that value changes in the other file it will never be updated in your file. I don't know what your requirements are.
    Last edited by 6StringJazzer; 05-23-2018 at 08:54 AM.

+ 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. Function to populate cell with specific text from an external txt file
    By exoscoriae in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-02-2013, 07:34 AM
  2. Specific external data from text file
    By Marco-Kun in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-21-2012, 11:13 AM
  3. Replies: 3
    Last Post: 02-17-2012, 09:22 AM
  4. GetPivotData refer to external cell
    By Michael S in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-15-2006, 05:35 PM
  5. [SOLVED] Using 'If' refer to specific words in a cell containing text
    By Casino Guy in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 07:05 PM
  6. [SOLVED] Using 'If' refer to specific words in a cell containing text
    By Casino Guy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  7. [SOLVED] Using 'If' refer to specific words in a cell containing text
    By Casino Guy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  8. [SOLVED] Using 'If' refer to specific words in a cell containing text
    By Casino Guy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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