+ Reply to Thread
Results 1 to 8 of 8

How to combine external + local path

  1. #1
    Registered User
    Join Date
    08-10-2020
    Location
    Netherlands
    MS-Off Ver
    2019
    Posts
    81

    How to combine external + local path

    I have a cell in a closed workbook I need to refer to.
    But the cell address for that workbook is on Activesheet.

    So I need to somehow build / combine a formula like this:

    ='[ExternalFile.xlsx]Sheet1'! & Activesheet.Range("A1")

    Activesheet.Range("A1") contains the line "C200",
    which is the cell I need to refer to.
    So I'll probably need the "INDIRECT" function as well...

    Does anyone know how to build this formula?

  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,053

    Re: How to combine external + local path

    Exactly what are you trying to do? INDIRECT does NOT work with closed workbooks.

    On second glance: is this actually a VBA question??
    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
    Registered User
    Join Date
    08-10-2020
    Location
    Netherlands
    MS-Off Ver
    2019
    Posts
    81

    Re: How to combine external + local path

    I'll try to explain differently:

    I need to build a path to a cell in a closed workbook.
    I can refer to that cell directly using this line (which actually works):

    Please Login or Register  to view this content.
    The problem in this line is the $C$200 part, since on Activesheet
    I have cell $A$1 which contains the value "$C$200".
    How can I combine the (closed) workbook path with this cell value?
    Do I really need INDIRECT for this (since it doesn't work with closed workbooks)
    or is there another way?

    Why do you think I have a VBA question?
    I posted this in the "Excel Formulas & Functions" section, right?

  4. #4
    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,053

    Re: How to combine external + local path

    There is no need for sarcasm... (which is how your comments read to me), as many people post in the wrong place.

    I was confused by this "Activesheet.Range("A1")" which made me think it might be about VBA. I still don't know what Activesheet is...

    Please post a sample sheet SHOWING what you are trying to do.

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: How to combine external + local path

    Agreed with Glenn. Sounds sarcastic.
    As I understand that reference cell address is located in cell A1 on some sheet (Activesheet at this moment) and OP wants to get value from external, closed xlsx file.
    As INDIRECT does not works with closed files, I do not see possibility to get it by formula.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  6. #6
    Registered User
    Join Date
    08-10-2020
    Location
    Netherlands
    MS-Off Ver
    2019
    Posts
    81

    Re: How to combine external + local path

    Quote Originally Posted by Glenn Kennedy View Post
    There is no need for sarcasm... (which is how your comments read to me), as many people post in the wrong place.

    I was confused by this "Activesheet.Range("A1")" which made me think it might be about VBA. I still don't know what Activesheet is...

    Please post a sample sheet SHOWING what you are trying to do.
    Your post actually sounded sarcastic to me to start with,
    since you were using CAPITALS and multiple question marks ;-)
    But my apologies if I sounded sarcastic, and thank you for your comments.
    I now know I need to find an other way into this!

    PS: I accidentally presumed Activesheet was a well know term on this forum
    (since I do a lot of VBA posts indeed).
    Activesheet is just the sheet you are currently working on, that's all ;-)

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: How to combine external + local path

    It is well-known in the VBA section where the VBA experts hang out. It won't be well-known here in this section!

    For what it's worth, I did not read your comment as sarcastic, taking into account that your first language probably isn't English, but I can see why others might have read it as such. However, I don't see that there was any sarcasm in Glenn's preceding post, either. He was just trying to clarify what you really wanted, and I do agree that your opening post was ambivalent. As Glenn said, many people post in the wrong place, either accidentally or in error.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Registered User
    Join Date
    08-10-2020
    Location
    Netherlands
    MS-Off Ver
    2019
    Posts
    81

    Re: How to combine external + local path

    I actually didn't think there was such a difference between those sections,
    so thank you for pointing that out! I'll remember that next time I need to post a question.

    (English isn't my first language indeed ;-) )

+ 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. Find path to local synced sharepoint folder
    By rob vandebergh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-16-2020, 01:06 PM
  2. VBA Code to copy Files From Onedrive Folder To Local Path
    By hrayani in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2020, 01:29 PM
  3. [SOLVED] Embed multiple images from local path
    By leoxanigm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2016, 03:53 PM
  4. network path changed to local
    By dspel79082 in forum Excel General
    Replies: 1
    Last Post: 01-13-2015, 06:35 PM
  5. How To Download multiple pdf from website directory to local path
    By krraj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2014, 08:09 AM
  6. Copy Outlook email attachments to Local drive(specified Path)
    By Nanimadhu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2014, 08:26 AM
  7. Excel VBA get Network path from local path
    By katto01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2013, 11:31 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