+ Reply to Thread
Results 1 to 8 of 8

How to reference cells from a closed workbook with a formula

  1. #1
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    How to reference cells from a closed workbook with a formula

    Hi forum,

    I have been unable to find an answer for this but is there a way to reference a cell from a closed workbook?
    I know that you can use INDIRECT to reference from an open workbook but that doesn't seem to work with closed workbooks and just produces #REF.

    Is there a way? Please see attached documents for a VERY SIMPLE Mockup.

    EDIT: For reference, the actual (not Mockup) closed workbook is on Microsoft SharePoint is this changes anything.

    Kind Regards,

    Julian
    Attached Files Attached Files
    Last edited by JulianS96; 03-14-2024 at 06:32 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: How to reference cells from a closed workbook with a formula

    Your example may be just too simple. If ALL you want to do is draw A2 from the closed sheet:

    ='[closedbook.xlsx]Sheet1'!$A$2

    and refresh links when prompted. But... it really depends on the other bits you haven't told us about yet!!
    Last edited by Glenn Kennedy; 03-14-2024 at 06:41 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    Re: How to reference cells from a closed workbook with a formula

    Ok let me try that.
    I just wanted to get the bare bones working first before I went further.
    EDIT: Ok that works. So strange that when I try something like that i get #REF or "this link could not be found" or words to that effect.

    Ok so the advanced level is that the workbook name and sheet name changes.
    There are 33 total workbooks with different names and sheet names.
    The Workbook name and sheet name are the same
    Example:
    Workbook name: result_wget_Sheet1.csv
    Sheet Name: result_wget_Sheet1

    The MS SharePoint location is the following: https://XXXXgroup.sharepoint.com/sites/114470/Shared Documents/1.Docs In/XXXX/HC data/12 2023/result_wget_Sheet1.csv
    Where the bits in red are the confidential bits.

    I initially tried INDIRECT of e.g. 'https://XXXXgroup.sharepoint.com/sites/114470/Shared Documents/1.Docs In/XXXX/HC data/12 2023/[result_wget_Sheet1.csv]result_wget_Sheet1'!A2 as the goal so building like
    A2 = 'https://XXXXgroup.sharepoint.com/sites/114470/Shared Documents/1.Docs In/XXXX/HC data/12 2023/[result_wget_
    B2 = SheetX
    B3 = .csv]result_wget_&B2
    B4 = '!&A2
    B5 = INDIRECT(A2&B2&B3&B4)
    But this didn't work for some reason. Sorry it's difficult to explain. The end result is this indirect does not work with closed workbooks.

    So basically what changes is the SheetX part of both the parts of the Sharepoint highlighted in blue

    Is it possible to build this formula dynamically so that i could drag it down so that each part updates based on e.g. Sheet A of workbook A, then next row down it references Sheet B of workbook B, Sheet C of workbook C and so on.
    I'll Mockup some workbooks.
    Attached Files Attached Files
    Last edited by JulianS96; 03-14-2024 at 07:23 AM.

  4. #4
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,423

    Re: How to reference cells from a closed workbook with a formula

    pls try this VBA code , but You can modify your storage path to be in the same path

    now is E:\temp\

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    Re: How to reference cells from a closed workbook with a formula

    Thanks wk, I'll try this and report back

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: How to reference cells from a closed workbook with a formula

    Your explanation WAS too simple. Basically, there is NO good, easily applicable formula that can pick up file names or csheet names from cells (the bits thta you didn't tell us about, as I suspected!!).

    Best to stick with VBA, if that can be tailored to meet your needs.

  7. #7
    Forum Contributor JulianS96's Avatar
    Join Date
    11-01-2019
    Location
    England
    MS-Off Ver
    365 (work-99%), 2016 (home-1%)
    Posts
    266

    Re: How to reference cells from a closed workbook with a formula

    Fair enough, that's unfortunate, but i suppose it makes sense. I guess the easiest way to get this to work is to put all the relevant sheets in one giant workbook, and reference each with an INDIRECT. Otherwise yeah, the VBA solution might have to suffice!

  8. #8
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,423

    Re: How to reference cells from a closed workbook with a formula

    JulianS96 You're Welcome. Glad to help . Thank You for the feedback.

+ 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] Formula to reference a closed workbook saved on a sharepoint site?
    By Bschutz in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-12-2019, 03:19 AM
  2. [SOLVED] Formula to reference cells from a closed workbook?
    By whahmira in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-20-2018, 12:00 PM
  3. I need to reference to another workbook that is closed.
    By pasqualebaldi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2016, 03:00 PM
  4. How to reference closed workbook
    By excelnewbie716 in forum Excel General
    Replies: 6
    Last Post: 10-08-2015, 12:06 PM
  5. Hard-coding formula to reference cell from closed workbook
    By ThomServo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-10-2015, 02:51 PM
  6. Cell reference a workbook even when workbook is closed
    By suban.p in forum Excel General
    Replies: 2
    Last Post: 11-04-2014, 12:08 PM
  7. Use cell value as reference to closed workbook?
    By ChrisKustom in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-17-2013, 12:32 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