+ Reply to Thread
Results 1 to 2 of 2

Grabbing Specific Fields from Worksheets from External Workbook - NO INDIRECT FORMULA

  1. #1
    Forum Contributor
    Join Date
    11-19-2019
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    546

    Grabbing Specific Fields from Worksheets from External Workbook - NO INDIRECT FORMULA

    Is there a way I can grab specific fields from each sheet, each sheet is standardized, and avoiding the Indirect formula.

    So from the 200 standardized sheets i would like to grab lets say cell c17. Is there a way to do that without using the Indirect formula? It seems as if this INDIRECT FUNCTION is pretty volatile.

    Thank you.

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

    Re: Grabbing Specific Fields from Worksheets from External Workbook - NO INDIRECT FORMULA

    Yes as long as you accept a multiple step procedure.

    If full pathnames were in column A from row 3 down, worksheet names in row 1 and cell addresses in row 2 from column C right.

    B3: =REPLACE(A3,FIND("|",SUBSTITUTE(A3,"\","|",LEN(A3)-LEN(SUBSTITUTE(A3,"\",""))))+1,0,"[")&"]"

    C3: ="='"&$B3&C$1&"'!"&C$2

    Select B3:C3 and fill down as far as there are pathnames in column A, say down to row 202. Select C3:C202 and fill right as far as there are worksheet names and cell addresses in rows 1 and 2, say into column AZ.

    Select C3, copy, and paste into C2 to keep a copy of the formula.

    The C3:AZ202 formulas return TEXT which looks like simple external reference formulas. Select C3:AZ202, copy, and paste special as values on top of itself. This converts the FORMULAS returning text into text CONSTANTS which look like formulas. With that range still selected, press [Ctrl]+H to display the Replace dialog. Enter = as both Find what and Replace with, and click Replace All . Yes, this replaces = with =, but that effectively enters all the text constants AS FORMULAS. You'd then have a 200-row by 50-column range of external reference formulas.

    That said, once you click Replace All, you might as well go have lunch because fetching that many values from likely closed workbooks will take A LOT OF TIME. You could reduce the time by using VBA as part of the process above. Basically copy C2, the cell with the original formula, paste into C3:AZ202, select C3:AZ202, copy and paste special as values. THEN step through each row in A3:A202, open the workbook with the pathname in the current row, select C:AZ in that row, replace = with = in all cells in that single-row range. Since the workbook would be open, the formulas should recalculate quickly. Then close that other workbook, and proceed to process the next row.

    There's probably a clever Power Query way to do this, but this is the approach I use.

+ 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] Using VLOOKUP with an External Workbook and the INDIRECT Function
    By ExcelHowie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-05-2021, 02:50 AM
  2. Linking to External Workbook Error - Indirect Alternative?
    By alohadboy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-27-2017, 12:19 PM
  3. Replies: 7
    Last Post: 01-10-2017, 11:11 PM
  4. Replacment for indirect function; external workbook is closed
    By zeko90 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-07-2015, 07:28 AM
  5. [SOLVED] Automatically open and close external workbook for indirect function
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-03-2013, 01:49 PM
  6. INDIRECT update with external workbook
    By papa_face in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-03-2008, 06:24 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