![]() |
VBA Loop through Specific Subfolders to find files (drill down 4 levels)
I have a complicated problem. I'm trying to loop through several directories to find a particular file. Here is a sample of my folder structure "MainDirectory/YYYYMMDD/DETAILS/FOLDER/File.xlsx".
My goal is to find that particular file, but I need to drill down to it. I have to start at that MainDirectory, because I need to loop through those date folders. There are other folders in that MainDirectory, which is why I'm trying to limit the search to just those date folders. Here is my code that lets me loop through the subfolders, but I can't drill down far enough to find my file. Code:
Public Folder_Name2 As String |
VBA Loop through Specific Subfolders to find files (drill down 4 levels)
Have a look here to see if this might be worth modifying for your
purposes... http://vb.mvpb.org/samples/DirDrill/ -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
VBA Loop through Specific Subfolders to find files (drill down 4 levels)
Garry,
I don't know about any other "lurkers" on here, but the link did not work for me. -pb |
VBA Loop through Specific Subfolders to find files (drill down 4 levels)
Garry,
I don't know about any other "lurkers" on here, but the link did not work for me. -pb Geez.., thanks for the feedback! Big typo on my part... http://vb.mvps.org/samples/DirDrill/ -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
All times are GMT +1. The time now is 03:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com