+ Reply to Thread
Results 1 to 4 of 4

Extract external workbook full path from formula

  1. #1
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Extract external workbook full path from formula

    Hi Excel VBA experts,

    I have the following formula which is a text.

    Please Login or Register  to view this content.
    How do I go about looking at this formula text from the end and search for a right square bracket ']' and if I do find it, continue searching towards the start of the string and find a single quote (') and then put it in a collection/dictionary which later than retrieve it to excel range.

    As you can see, in the above formula (which is made up and not tested), there's 3 external workbooks, that's colored in red, blue and orange. The one that color in lime is not an external workbook, but a sheet name within it's own workbook, and I'm not interested in it. I'm only interested in a string that starts with a single quote and have square brackets ([…]) as the sheet name.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi,

    use the VBA Split function with the single quote as delimiter then you can check each result if containing any square bracket …

  3. #3
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Extract external workbook full path from formula

    As above Marc L, but first use 'Replace' function for "'" and "!" with replacement e.g. "|", and then Split, and then a loop with 'IF' statement for Left(string, 2) = "\\", and then a 'Dictionary'.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    I forgot : using Split function a Dictionary is very not necessary …

+ 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] Power Query - Extract FileName for Full Path in Cell
    By jgarza0422 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2019, 10:20 AM
  2. Replies: 1
    Last Post: 11-18-2016, 03:33 PM
  3. Extract full name from path and open it (or not)
    By Remphan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2016, 03:36 AM
  4. Extract text from an external Excel using the file path only
    By gaker10 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-17-2015, 12:30 PM
  5. Full path of an Excel external link
    By Avillo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2010, 04:22 PM
  6. [SOLVED] extract filename from full path
    By Leung in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-03-2005, 06:05 PM
  7. [SOLVED] Identify Full Path of Opened Excel Workbook
    By monir in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-05-2005, 10:06 PM

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