Search for part of a file name

XLEAccessGuru

XLEGuru
Local time
Today, 11:07
Joined
Nov 17, 2006
Messages
65
I know file system object properties code, but I'm over-complicating how to search a file name for a string. For example, I want to find all files in C:\MyFolder that contain "ABC" in the file name.

Like I said, I'm overcomplicating this. Brain fried today so any help on what's probably pretty simple is appreciated. Thanks.
 
PS - I won't always be searching for "ABC" as the 1st 3 characters. It may be the last three or in the middle of 50 other characters in the file name.
 
Simple Software Solutions

If you transfer your thoughts to how you would perform a search using Windows search utility you would enter soming along the lines *ABC*.* or *ABC*.DOC if you knew the file extension.

What you need to do is to emulate this in your VBA when performing the search.

Prompt the user to enter the known criteria, in this case ABC, then surround it with the wildcard symbols.

CodeMaster::cool:
 
Thank you! It's actually not a user prompt, I'm searching for monthly reports that we run automated. I'm getting there though!
 

Users who are viewing this thread

Back
Top Bottom