Dir Function

jstevens
GoldLounger
Posts: 2628
Joined: 26 Jan 2010, 16:31
Location: Southern California

Dir Function

Post by jstevens »

The code below processes all files prefixed with a "6". Is it possible to do something like: "\6*.*,\5*.*,\4*.* Where all files prefixed with a 6,5 or 4 are processed.

strFileName = Dir("" & path & "\6*.*", vbHidden)

Thanks for taking a look,
John
Regards,
John

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Dir Function

Post by HansV »

No, you either have to execute three loops (one for file names starting with each digit), or execute a single loop for *.* and check the file name within the loop.
Best wishes,
Hans