+ Reply to Thread
Results 1 to 4 of 4

search parent directory for sub folders

  1. #1
    Registered User
    Join Date
    09-20-2013
    Location
    Flagstaff, Arizona, United States
    MS-Off Ver
    Excel 2010
    Posts
    1

    search parent directory for sub folders

    Hi all,

    Today my question is how to search a parent directory to look for sub folders named 'RAW'. I already have a code that works when you point directly to the raw folders but i have many different raw folders to perform the action too. Our folder structure is a parent directory with a date when the projects were completed and then is separated into a sub folder for each project(approx 60 projects). In each projects folder the is the sub folder named 'RAW'.

    Dubbbdan

  2. #2
    Forum Contributor
    Join Date
    05-08-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    102

    Re: search parent directory for sub folders

    Two things:

    [1] Open up your VBE, go to the References menu and, if it is not already done, click the checkbox for an item called Windows Script Host Object Model. The code below will not work without this being done.

    [2] Paste the following code into a blank module and run it. You will be asked to kick the process off by picking a folder. The output (which will show in Column A) will be a listing of all subfolders, and their subfolders, and their subfolders and so on of the folder that you picked. You can then filter for all those folders with "RAW" in the name.

    Please Login or Register  to view this content.
    _____________________
    [1] If this reply was helpful, click the star to the left.
    [2] If this reply answered your question, mark this thread as [SOLVED].
    Last edited by Dimitrov; 10-08-2013 at 01:19 AM.

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: search parent directory for sub folders

    Hi, Dimitrov,

    are you sure about your 1.) as the code uses Late Binding?

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Contributor
    Join Date
    05-08-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    102

    Re: search parent directory for sub folders

    @HaHoBe: You are right. I am using late binding. I switched it up halfway through writing the code and forgot about that.

    @dubbbdan: It won't hurt if you do not perform action [1] in my reply above; however, if you have already done it, no worries. I believe the code should run (either way). Props to HaHoBe for pointing that out.

+ 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] Parent Directory??
    By PQuayle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-07-2013, 06:30 PM
  2. Parent Directory??
    By PQuayle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2013, 05:44 PM
  3. macro to search in parent directory
    By jaango123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-15-2011, 02:00 AM
  4. Find parent directory
    By DudeFromAccDept in forum Excel General
    Replies: 4
    Last Post: 11-05-2008, 09:11 AM
  5. [SOLVED] How to determine the parent directory
    By KS Wong in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-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