ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   file search in subfolders (https://www.excelbanter.com/excel-programming/340241-file-search-subfolders.html)

Pflugs

file search in subfolders
 
Does anyone have a good bit of code to effectively search through a
designated folder and its subfolders? I have used code to search just one
folder, but I can't figure out how to incorporate all subfolders and their
subfolders. I have tried .Lookin, and that is unreliable.

Thanks for your suggestions.

Pflugs

file search in subfolders
 
I also want to be able to search by filesize ( 100 MB) and by date last
accessed (before a month ago). I am having some problems quickly obtaining
those values.

"Pflugs" wrote:

Does anyone have a good bit of code to effectively search through a
designated folder and its subfolders? I have used code to search just one
folder, but I can't figure out how to incorporate all subfolders and their
subfolders. I have tried .Lookin, and that is unreliable.

Thanks for your suggestions.


NickHK

file search in subfolders
 
Pflugs,
I would advise against the .FileSearch function that comes with Office, as
many people report flaky results in all versions & apps.
Use VB intrinsic functions:
http://vb.mvps.org/samples/project.asp?id=DirDrill

You can add your own checks for FileLen and FileDateTime on each file.

There are other ways of achieving you aim but this will get you started.

NickHK

"Pflugs" wrote in message
...
I also want to be able to search by filesize ( 100 MB) and by date last
accessed (before a month ago). I am having some problems quickly

obtaining
those values.

"Pflugs" wrote:

Does anyone have a good bit of code to effectively search through a
designated folder and its subfolders? I have used code to search just

one
folder, but I can't figure out how to incorporate all subfolders and

their
subfolders. I have tried .Lookin, and that is unreliable.

Thanks for your suggestions.





All times are GMT +1. The time now is 12:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com