+ Reply to Thread
Results 1 to 5 of 5

Listing files and folders using FSO

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Listing files and folders using FSO

    I want to list files and folders with the macro below.
    The rules are as follows.
    1. For any folder containing the name "SPECIAL", only the folder should be listed. No files, just the folder name.
    2. For any other folder, only the files are listed within.



    I am having issues with the first criteria, in that I get multiple listing of the same folder.
    The feature which adds rows needs to be kept as it will allow me to place new data in between existing data.

    Is there a change to make it work ... without changing the structure of the code.
    Also there is another unusual feature, files seem to get listed alphabetically whereas folders are listed in reverse order.


    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Listing files and folders using FSO

    Will this be possible?

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Listing files and folders using FSO

    Hello Un-Do Re-Do,

    See if this amended version of your workbook is correct.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Listing files and folders using FSO

    Hi. Thanks for looking into.
    Unfortunately it has the same issue.
    If you try with multiple folders with the "SPECIAL" tag, you'll get multiple listings.
    Inserting data between existing is also important.
    Last edited by Un-Do Re-Do; 08-31-2019 at 12:04 AM.

  5. #5
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Listing files and folders using FSO

    This seems to have worked.
    Please Login or Register  to view this content.

+ 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. Replies: 5
    Last Post: 11-02-2018, 03:15 AM
  2. Use Excel VBA to Copy multiple files from different source folders to different folders
    By mm1234mail in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2014, 01:17 PM
  3. Replies: 1
    Last Post: 09-12-2013, 09:23 PM
  4. Listing folders with VBA
    By mgkyle in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-07-2012, 01:42 AM
  5. Listing folders and subfolders
    By brokenbiscuits in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-11-2011, 08:49 AM
  6. Create folders and move and copy files into that folders
    By vijaybharthi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2010, 04:01 AM
  7. listing files from folders
    By Suej68 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2010, 07:29 PM

Tags for this Thread

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