+ Reply to Thread
Results 1 to 2 of 2

List all folders/files?

  1. #1
    Registered User
    Join Date
    08-10-2015
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    List all folders/files?

    Hello All

    I am new to this forum and have limited knowledge of VBA.

    I need a macro that will list all folders and files within a specified directory on my computer, but in a particular way.

    Ordinarily, windows lists files first and then folders. I need the Macro to list folders first then files. I also need the macro to create index numbers for each line and for the index numbers to be sequential (not independent for files and folders). Ideally this would be displayed in an excel sheet in 2 separate columns. Here is an illustration :

    01. Folder A
    01.01 Folder A.A
    01.01.01 File A.A.A
    01.01.02 File A.A.B
    01.02 Folder A.B
    01.03 File A.A
    02. Folder B
    03. Folder C
    03.01 Folder C.A
    03.02 File C.A
    04. File A
    05. File B


    Any suggestions would be much appreciated.

    Many thanks,

    MacManzx

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: List all folders/files?

    See Chip Pearson's site, here:

    http://www.cpearson.com/Excel/foldertreeview.aspx

    for a macro that will list all files and folders.

    Hope this helps.

    Pete

+ 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. Loop through several folders and rename files using a lookup list
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2015, 11:20 AM
  2. Replies: 2
    Last Post: 04-11-2015, 07:20 AM
  3. Searching folders for list of files
    By joltremari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2014, 02:09 PM
  4. Replies: 0
    Last Post: 07-13-2012, 10:51 PM
  5. List files in folders in excel
    By jayblack in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-21-2010, 07:25 AM
  6. Map/List of folders, subfolders & files
    By Bogdan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2006, 01:10 PM
  7. Can anyone help me Create Excel list of files in windows folders
    By solrac1956 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-28-2005, 07:10 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