+ Reply to Thread
Results 1 to 5 of 5

Macro to export folder and subfolder names in Excel?

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

    Macro to export folder and subfolder names in Excel?

    I have a main folder, which has 50 subfolders, some of which each have 2-10 subfolders under them. Using the macro in Post #2 here, I was able to get a list of the first tier of subfolders. Is there any way to modify that macro to list all levels of subfolders?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,926

    Re: Macro to export folder and subfolder names in Excel?

    Here is a recursive solution based on the code you linked. Let me know if you need to show indentation to indicate depth.

    Please Login or Register  to view this content.
    I love it when a recursive solution is the most elegant for a problem.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Macro to export folder and subfolder names in Excel?

    hi Mustang,

    Welcome to the Forum

    This wee collection of macros from my personal.xls may work for you. I suggest adding them to a separate module & giving it ago by running the first macro (which calls the others)...

    Edit (after posting I saw post # 2): 6Stringjazzer beat me to it, but here's something very similar.

    Please Login or Register  to view this content.
    hth
    Rob
    Last edited by broro183; 03-02-2010 at 02:36 PM.
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

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

    Re: Macro to export folder and subfolder names in Excel?

    6String - that works great! If it's possible to have indentation as well, that would be most helpful...

    Rob - thanks very much for your help. I'm going to hold out for 6String's response before I try yours out...

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,926

    Re: Macro to export folder and subfolder names in Excel?

    This revision will indent the folder name in the first column. You can apply the same thing to other columns as desired.

    Please Login or Register  to view this content.

+ Reply to 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