+ Reply to Thread
Results 1 to 3 of 3

Help with Macro to find full path of Folder, using input of first 4 chars of folder name

  1. #1
    Registered User
    Join Date
    11-18-2015
    Location
    VA
    MS-Off Ver
    2016
    Posts
    19

    Help with Macro to find full path of Folder, using input of first 4 chars of folder name

    I could use a bit of help with a code I'm working on.
    Essentially, I need to open a file, and I know where it is.
    Unfortunately, I prefer not to remember ten thousand file folder names or to have to manually enter them into this code.
    I know where the file is located and how to get to the directory where they are located. No problem.

    What I need is, when I manually input the job number, for example "1234", it will search for the actual folder which is named "1234 - Tree House Lane Remodel".


    Please Login or Register  to view this content.
    Thank you very much and happy holidays.

    Edit: I forgot to add, the file will be something like "THL - BOMs.xls" or "THL - BOMs.xlsm" where "* - BOMs.xls*" is the same.
    Last edited by Anxiety; 12-23-2015 at 04:25 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help with Macro to find full path of Folder, using input of first 4 chars of folder na

    Use this as a starting point

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    11-18-2015
    Location
    VA
    MS-Off Ver
    2016
    Posts
    19

    Re: Help with Macro to find full path of Folder, using input of first 4 chars of folder na

    This isn't precisely what I need.
    Basically, I just need to open a file and I know its location, but what I don't know is the full name of one folder.
    For example, I want to lookup a specific job number "1234", and the full job name would be called "1234 - Tree House Lane Remodel".
    The full path would be "P:/1000 Series Jobs/1234 - Tree House Lane Remodel/Engineering/Dwgs/THL - BOMs.xmls".
    There are thousands of these files, and I'd like to look them up simply by entering the job number "1234".
    I can figure out everything except for a type of wildcard for the folder "/1234 - Tree House Lane Remodel/".
    I've tried " & JobNo & " - *" but wildcards do not work when looking up directories.

    Your code can certainly give me a file name that I don't know entirely, however, I can't seem to get the directory.

    Edit:
    I just figured out how to find a full path based on some variables. Apparently my syntax was a bit off and had to fiddle with it to work.
    Here's my code if anyone's interested.

    Please Login or Register  to view this content.
    Last edited by Anxiety; 12-28-2015 at 10:24 AM.

+ 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. Replies: 2
    Last Post: 12-29-2015, 04:19 AM
  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. Open Folder (Prompt User for final folder name in location path)
    By synergeticink in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2014, 03:33 PM
  4. [SOLVED] Copy files from one folder to another folder (path in textbox)
    By yoko21 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2014, 02:45 AM
  5. 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
  6. List folder path according to folder index
    By naflas in forum Excel General
    Replies: 4
    Last Post: 07-15-2010, 07:33 PM
  7. [SOLVED] Full folder path from BrowseForFolder
    By Jon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-02-2006, 06:15 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