Log in

View Full Version : Find folder based on part of filename?



clhare
08-18-2011, 12:57 PM
I need to locate a folder by macro, but I'll only know the path and the last 10 characters of the folder's name. Is this possible to do?

Thanks!

Frosty
08-19-2011, 09:39 AM
Take a look at the FileSystemObject (do a search on that term and you'll find plenty of samples)

It's definitely possible to do, but it could take a long time (like any search) if you don't limit it down to a narrow set of criteria (you say you know the path...). I just gave a couple of samples of the different ways of doing this stuff (one of which uses the FSO) in another thread.

http://www.vbaexpress.com/forum/showthread.php?t=38689