Does file name contain the characters XYZ
Sub Here()
If Dir("\*" & "_XYZ_" & "*.xls") = "" Then
MsgBox "nope"
Else
MsgBox "yup"
End If
End Sub
Ed Peters wrote:
Hi,
I'm trying to find out if a folder contains any files .
The name of the file varies but always contains _XYZ_
How would I find out if there is a file ?
I can do a file that I know the name of :
eg
If dir("\test.xls") = "" then
exit
else
end if
I think the answer is very simple but can't see it at the mo!
Thanks,
Ed
|