+ Reply to Thread
Results 1 to 6 of 6

Adapt macro to create list of all PDF files in folder, including subfolders.

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Adapt macro to create list of all PDF files in folder, including subfolders.

    Hi all,

    I'm looking for a way to modify the code below (found on the MS website) to enable it to return results from all of the subfolders in the directory listed. I have thousands of subfolders in this directory so this would be far too time consuming to run this code individually in each one!

    Please Login or Register  to view this content.
    Thanks in advance for any help!

    Glen

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Adapt macro to create list of all PDF files in folder, including subfolders.

    Slightly different way...
    Please Login or Register  to view this content.
    Last edited by cytop; 08-23-2013 at 05:55 AM.

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Adapt macro to create list of all PDF files in folder, including subfolders.

    Edit: Ok try this.

    Please Login or Register  to view this content.
    Last edited by millz; 08-23-2013 at 05:59 AM.

  4. #4
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Adapt macro to create list of all PDF files in folder, including subfolders.

    Cytop, that's great - I was hoping to be left with just the filename, but I can run a formula to separate the filename from that in no time.

    Millz, I can't get yours to work - it hangs on the "Dim FS As New FileSystemObject" line with a compile error: "User-defined type not defined".

    Thanks for the speedy responses guys!

  5. #5
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Adapt macro to create list of all PDF files in folder, including subfolders.

    Seems like you are missing out the reference. Try the solution here on how to add the reference.

  6. #6
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Adapt macro to create list of all PDF files in folder, including subfolders.

    Ahh beautiful. That did the trick! I now have two identical lists of all of the PDF files in that directory, one from each method (I had already trimmed down the names from cytop's solution). Thanks for both of your answers, they have been most helpful!

+ 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] list of subfolders in folder - without files and sub-subfolders
    By MartyZ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2022, 10:56 AM
  2. Macro to create hyperlink list of every file in a folder, subfolders, and SHORTCUTS
    By Billdick7788 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2013, 11:11 AM
  3. [SOLVED] Amending various excel files including those in subfolders MACRO
    By gonzalraf in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-20-2013, 02:15 PM
  4. Macro to search folder including subfolders for file and open
    By kiraexiled in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2012, 02:45 PM
  5. Counting files in folder including subfolders also and folder size
    By mido609 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2012, 03:26 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