Using Excel Macro to Browse through folders and delete selectively ?
Posted by Dave on January 27, 2002 10:50 PM
I'm unsure if an Excel macro is my best option here, but I have about 3500 folders (with very cryptic names) in a certain directory (from a data recovery program, I can't believe I deleted my hard drive!!) that I need a program to run through, look for certain conditions (eg. the folder contains a *.doc or *.xls file), and deletes or keeps the folder if it meets these certain conditions.
I know Excel has access to certain methods such as deletefolder, but what about functions that allow me to manipulate a list of folders e.g:
for each folder in currentfolder
if !contains(*.xls || *.doc)
delete (folder)
next folder
How do I retrieve and manipulate this list of folders in an excel macro?
thanks in advance !!