+ Reply to Thread
Results 1 to 12 of 12

List files in folders in excel

  1. #1
    Registered User
    Join Date
    05-18-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    List files in folders in excel

    Hey,

    iv'e been searching for a few days now and i can't seem to find a code to list files in folders.

    I am using excel 2007, my knowledge of macro's is more or less limited.

    what i need is a program that can find .docx files in a folder and its subfolders. and list them in excel. Date last modified would be nice to have tho.

    i need to be able to save the xl file and update it when it opens if possible.

    any help is appreciated...my boss needs this bad haha

    Regards, Jason

  2. #2
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: List files in folders in excel

    This should do what you want.
    This will put the list in the 1st 3 columns of the ActiveSheet.
    Edit ShowFileList() to put in the folder and extension desired.
    Just select the sheet you want the list on, make sure the 1st 3 columns don't have anything in them you want to keep, and run "ShowFileList()"
    Be sure and back up your workbook 1st, in case there's a bug I didn't see.
    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  3. #3
    Registered User
    Join Date
    05-18-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List files in folders in excel

    hey, thanks for the quick reply! very cool

    I am getting a compile error 35 like i said i'm not very knowledgeable when it comes to excel, i think it has something to do with the name...but thats just a guess

    this is what i see

    \1



    thanks for your help once again!

    Jason

  4. #4
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: List files in folders in excel

    Sorry about that. I saw that you were using Excel 2007 (which I'm not) and I included a function that I thought 2007 had. I was wrong. I should have looked it up first.
    I've put it all in a file, so it should work right.List.xls

  5. #5
    Registered User
    Join Date
    05-18-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List files in folders in excel

    I tried the list file and it gets bogged down,

    i'm not sure if it was for excel 2003 , or did you mean that the new one was for 2007?

    in any case, i tried using the file and it locked on me : S

    Jason

  6. #6
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: List files in folders in excel

    It's written in Excell 2002, but it should still work in 2007.
    I tried moving up 2 folder levels to see if it gets bogged down with too many files, and it didn't list any. There's obviously a bug in it. I'll work on it.

  7. #7
    Registered User
    Join Date
    05-18-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List files in folders in excel

    Alright, thanks fox!

    i appreciate the work, it helps a lot haha

    Jason

  8. #8
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: List files in folders in excel

    jayblack;

    Ok, here is the file List.xls. I tested it on several folders. Also added StatusBar entries, so you can see that it's working and not stuck. It went through over 4900 folders and 120,000 files without a hitch.

  9. #9
    Registered User
    Join Date
    05-18-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List files in folders in excel

    Wow,


    that is very impressive! it works great and is just what i wanted.

    Thanks a bunch fox

    regards, jason

  10. #10
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: List files in folders in excel

    My Pleasure. If you really like it, rate it by clicking the blue scales above right side of screen.

  11. #11
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: List files in folders in excel

    jayblack;

    I'll keep this thread in my subscriptions list for at least a month, in case you write more. After that you'll have to send me a private message to let me know you're back

  12. #12
    Registered User
    Join Date
    05-18-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List files in folders in excel

    alright, thanks

+ 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