Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does file name contain the characters XYZ
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
File names appended with ~ plus alphanumeric characters | Excel Discussion (Misc queries) | |||
how to increase number of characters of file name in excel | Excel Discussion (Misc queries) | |||
Unreadable characters in file with Print #File in VBA | Excel Programming | |||
CSV file containing german characters imported into Excel | Excel Discussion (Misc queries) | |||
deleting last 4 characters from file name | Excel Programming |