Hello!
I am new here and I hope you can help me as I am a noob when in comes to macros.
I have a macro that I want to create that can list down all the file name and the file path of each item inside a folder.
I also want this macro to list the items inside a subfolder. Note that there is also a subfolder inside the subfolder but I don't want to list down the files on the deeper subfolders.
Please see the screenshots below.
When I choose the folder name " Folder to Check", what I need is for the macro to run through all the sub folders "1 to 5" listing down all the PDF file names but will not include the PDF files inside the subfolder ABC.
Please note that these are just sample folder names but it is basically the logic of it. Some subfolders have multiple subfolders inside which I want to exclude with out specifying their names. Is this possible? Can you please edit the below code if it can be done on that? Thank you very much and I would really appreciate it!
I am new here and I hope you can help me as I am a noob when in comes to macros.
I have a macro that I want to create that can list down all the file name and the file path of each item inside a folder.
I also want this macro to list the items inside a subfolder. Note that there is also a subfolder inside the subfolder but I don't want to list down the files on the deeper subfolders.
Please see the screenshots below.
When I choose the folder name " Folder to Check", what I need is for the macro to run through all the sub folders "1 to 5" listing down all the PDF file names but will not include the PDF files inside the subfolder ABC.
Please note that these are just sample folder names but it is basically the logic of it. Some subfolders have multiple subfolders inside which I want to exclude with out specifying their names. Is this possible? Can you please edit the below code if it can be done on that? Thank you very much and I would really appreciate it!
Excel Formula:
For Each oSubfolder In oFolder.SubFolders
queue.Add oSubfolder
Next oSubfolder