Closed Thread
Results 1 to 6 of 6

Macro to list folder names within a directory

  1. #1
    Registered User
    Join Date
    11-22-2009
    Location
    Newcastle,England
    MS-Off Ver
    Excel 2003
    Posts
    78

    Macro to list folder names within a directory

    Hi guys,

    Thanks for all the help recently but I am not yet done! Now i'm looking for a macro which within a sheet named "foldernamedump" will list in a column the folder names within a directory I specify.

    I have seen a couple of sample codes but I just cant seem to get them working at all so I think its best to start from scratch and the work i get supplied here is always perfect.

    I also want the macro to clear the contents of the sheet before it loads again just to ensure there is no old data within the sheet.

    Thank you for any help
    Last edited by munkee; 11-26-2009 at 04:04 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to list folder names within a directory

    Hello munkee,

    This macro will all the folders in a given directory. The list is output to the "Sheet1" starting in cell "A2". The folder name, path, and size are printed in the same row. You can change the directory, worksheet, and starting cell. They are all marked in red.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Macro to list folder names within a directory

    Try this

    Please Login or Register  to view this content.
    Martin

  4. #4
    Registered User
    Join Date
    11-22-2009
    Location
    Newcastle,England
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to list folder names within a directory

    Thanks guys =]

  5. #5
    Registered User
    Join Date
    11-17-2005
    Posts
    6

    Re: Macro to list folder names within a directory

    Is there any way to modify this macro to capture not only folder names within the top folder, but also 2nd-level subfolders?

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to list folder names within a directory

    Hello Mustang,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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