Results 1 to 3 of 3

Thread: Article: Count Files (with a specific extension or not) in a Folder

  1. #1
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,251
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider

    Article: Count Files (with a specific extension or not) in a Folder



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  2. #2
    I've been using this on my PC with no problems, I've now got a Mac and I can't seem to make it work on here. Any tips?

  3. #3
    Hi Ken. Very good code.

    It seems all the charm is in there:


    Set objFso = CreateObject("Scripting.FileSystemObject") Set objFiles = objFso.GetFolder(strDirectory).Files

    In my case I need not only to count files but also to process each individual file after getting that number of files. Using a For Next loop. How can I index each file to do that? is there any other attribute to use?

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •