Posts by anmac1789

    Does anyone want to answer this question? Does anyone have a clue where to begin? I have been waiting for so long to get a reply but nothing...the last thread I made got responses but this threat it seems everyone just left the forum and does not want to answer even though I made a detailed post. Does anyone want to respond to this or should I make a new thread?

    This forum seems dead

    This post is in continuation from excluding folder paths with spaces

    My next question is how to :

    1. exclude 1st level subfolder(s) & deeper nested subfolder(s) (2nd..3rd..4th) that are still listed (see image attached of excel worksheet). I would like to exclude everything inside including the excluded folder itself from the list, not just the contents inside that subfolder....

    2. Recursive listing of parent paths...list to be continued below as each parent folder is added and searched

    If other deeper nested subfolders have the same name within the 2nd, 3rd, 4th subfolder level then in that case, would a folder path would make sense to exclude instead of names?

    so basically, your saying that I just need to add a "\" to the parent path ?? Also, what if i want to get all subfolders within a parent directory but I want to exclude a deeper nested subfolder ? how can I adjust the code?

    it almost works except for one thing. I have attached the same format except its for a different folder for which it doesn't work for, Basically, it shouldn't show any list because there is no file under the "a" folder. I have adjusted the code to take into your substitutions. Please take a look:

    updated code:

    Hello, this post is in response to the thread posted here:

    List files macro, need to add exclude specific subfolder in it - Excel General - OzGrid Free Excel/VBA Help Forum

    and also here: excluding folder paths - Excel General - OzGrid Free Excel/VBA Help Forum

    My question is that this code does not take into account excluding folder paths with spaces. For example, searching path "C:\KINGSTON 240GB SSD" and lets say I have a subfolder called "Documents" inside that parent folder. If I am typing "Documents" (without quotes) in cell A3 and click "list files in subfolders less exception list" then I get a list of all files within "Documents" folder. Which is not what this code is supposed to do. How can I fix this ?

    As proof here is my code and a screenshot of the folder structure:

    my original question was regarding this post: List files macro, need to add exclude specific subfolder in it

    First, It seems like when I tested this macro, it doesn't seem to work for folder names with spaces in them for example "C:\test 1"

    Next, it only seems to exclude top level directory folders, not deeper nested folders within the parent directory. How can this macro be adjusted to exclude deeper nested subfolders?

    Next, how can I make this macro display folder paths in addition to the file paths including the path of the parent folder?

    Next, when excluding a folder with no files in it, the other file paths in different subfolders get duplicated. How can this be fixed also? it seems like alot is wrong with this code that I wish to extend functionality for.

    I am attaching 2 pieces of code that I used in seperate workbooks so you can see what functionality I want added

    Hello, this post is in response to here: List files macro, need to add exclude specific subfolder in it

    excludedSubfolders As String = ""

    What does the above line mean? and also,

    What exactly is the above code doing here?