+ Reply to Thread
Results 1 to 7 of 7

Formula with brackets in folder path not working

  1. #1
    Registered User
    Join Date
    10-10-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    28

    Question Formula with brackets in folder path not working

    Morning all,

    I am having an issue using the below formula. I am trying to input a range of cells from another file using this;

    ='C:\Folderpath\[workbookname.xlsx]sheetname'!A1

    This works with any folder path so long as it does not have brackets/parentheses in it. E.g this below will not work (get the 'There's a problem with this formula) msg;

    ='C:\Folderpath(1)\[workbookname.xlsx]sheetname'!A1

    Anyone got any idea how I get around this? I need to be able to use this formula above

    Cheers,

    D

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Formula with brackets in folder path not working

    Works fine for me, Excel 2013
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    10-10-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    28

    Re: Formula with brackets in folder path not working

    THREAD CORRECTION

    My apologies, it has nothing to do with the brackets/parentheses! The folder names have an apostrophe in as below. This is what is causing the issue. Any ideas how to get around this? I cant change the folder names.

    ='C:\Folderpath'(1)\[workbookname.xlsx]sheetname'!A1

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Formula with brackets in folder path not working

    This should work, use two apostrophes in the path name


    ='C:\Folderpath''(1)\[workbookname.xlsx]sheetname'!A1

  5. #5
    Registered User
    Join Date
    10-10-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    28

    Re: Formula with brackets in folder path not working

    Quote Originally Posted by Special-K View Post
    This should work, use two apostrophes in the path name
    Yeah that works. Any idea how I could add another apostrophe in VBA? I'm doing a whole bunch in a loop.

    Currently I'm using this;

    Please Login or Register  to view this content.
    I guess I will need an if statement that identifies an apostrophe in Filepath and adds one next to it?

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Formula with brackets in folder path not working

    You might use Replace
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  7. #7
    Registered User
    Join Date
    10-10-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    28

    Re: Formula with brackets in folder path not working

    Thanks for the help guys, working great.

    D

+ 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. Formula to include data from drop down in the folder path
    By chrisnash70 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-08-2018, 12:09 PM
  2. How to validate an input dat folder/directory path whether the path has any spaces
    By mahendra.asapu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2015, 02:39 AM
  3. Choosing folder path (instead of file path) in VBA
    By sminter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-23-2014, 08:50 PM
  4. Code to list the folder path and sub folder path of a specific file
    By kalai1587 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2013, 03:51 AM
  5. Specified folder path to select file path
    By JayEmTee91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2012, 10:38 AM
  6. Replies: 5
    Last Post: 04-19-2012, 09:02 AM
  7. Finding folder name from a file path - formula
    By jamesryan in forum Excel General
    Replies: 2
    Last Post: 02-04-2009, 06:59 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