New Member

Hi Kelly,
You might be able to accomplish this by splitting your search string into separate strings and using instr() to find matches. This would require checking every file in the directory for matches to each search term. Something like this maybe:

str_search1 = "Kelly"
str_search2 = "Mort"

'Grab your next file name here
str_fileName = "Mort Kelly.xxx"

if instr(1, str_fileName, str_search1, vbTextCompare) > 0 then
if instr(1, str_fileName, str_search2, vbTextCompare) > 0 then
'Found a file name that has both terms
End If
End If

New Member

This was just a simple mockup not a full solution. The idea here is that you can get the name you are looking for in a string and split it into multiple search terms. Then you can search each of those terms individually. The instr() function searches for a search term anywhere in the string. If the first term is found, then we search for the second term. If they both are found, then you have a match.

Well-known Member

This was just a simple mockup not a full solution. The idea here is that you can get the name you are looking for in a string and split it into multiple search terms. Then you can search each of those terms individually. The instr() function searches for a search term anywhere in the string. If the first term is found, then we search for the second term. If they both are found, then you have a match.