+ Reply to Thread
Results 1 to 5 of 5

Get List of files name and path from a folder including all sub folders

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    41

    Get List of files name and path from a folder including all sub folders

    I plan to pull files and path name from a folder.
    I make 2 function or sub routine for handle 2 different option:
    1. ONLY list files in a folder NOT INCLUDING sub folder and sub of sub folder(if any)
    2. List of files and path name INCLUDING sub folder and sub of sub folder(if any)

    For option number 1 got
    Please Login or Register  to view this content.
    Get folder function is
    Please Login or Register  to view this content.
    My Target is:
    Modify script for list files and path name on OPTION 1 to get OPTION 2.

    My Question is
    What is the command for reaching My target?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Get List of files name and path from a folder including all sub folders

    If you search for this...
    List all files in a folder and subfolders site:www.excelforum.com
    ...you will find many threads that provide code for exactly what you are looking for.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Get List of files name and path from a folder including all sub folders

    AlphaFrog,
    Thank you for your guide.
    I got this one(and it works)
    Please Login or Register  to view this content.
    Base on this example I want to modify my OPTION 1 part
    Please Login or Register  to view this content.
    Become OPTION 2 (able to list all sub folders)

    Please Login or Register  to view this content.
    I try the last part without any success..In need your help on this part.

    Regards,
    Benny

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Get List of files name and path from a folder including all sub folders

    I'm not sure what you are asking?

    The True argument includes subfolders. Change it to False if you want to exclude subfolders.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-25-2012
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Get List of files name and path from a folder including all sub folders

    AlphaFrog,
    Thank you for your answer on "Call ListFilesInFolder(xDir, True)"

    Please Login or Register  to view this content.
    One more thing I want to ask you.
    I have the following script for List File Name in a folder NOT INCLUDING any Sub Folder on it.

    Please Login or Register  to view this content.
    My question is "How to modify Sub ListFileName_NotIncludingSubFolder() above to have ability for listing file name in a folder INCLUDING sub folders (if any)?"


    Regards,
    Benny

+ 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] macro to list files in folder and sub folders has stopped working
    By Lmel0611 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2015, 09:12 PM
  2. [SOLVED] Recursive List Folder include hidden & system folders and files
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2015, 03:45 PM
  3. Replies: 0
    Last Post: 10-15-2014, 04:37 AM
  4. [SOLVED] VBA function to list all files in a folder with path
    By szpt9m in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-27-2013, 02:26 AM
  5. Adapt macro to create list of all PDF files in folder, including subfolders.
    By Glensafro in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2013, 06:33 AM
  6. Replies: 0
    Last Post: 07-13-2012, 10:51 PM
  7. Replies: 1
    Last Post: 05-24-2007, 07:28 AM

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