distinguishing filenames

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

in Excel 2003
I'm using ...

MyPath = ThisWorkbook.Path & "\"
FilesInPath = Dir(MyPath & "*.ORG.2008BP.xls")

to select files for processing

how would I distinguish between files that are named

#= single numeric character

##.####.ORG.2008BP.xls

and

##.ORG.2008BP.xls

"##.####.ORG.2008BP.xls" didn't work
 
The simpliest way is to check the legth of the filename

MyPath = ThisWorkbook.Path & "\"
FilesInPath = Dir(MyPath & "*.ORG.2008BP.xls")
if len(FileInPath) = 22 then

else


end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Open CSV File 4
Type Mismatch 1
Get data reference to last row 5
Dir help 3
NEED HELP!!!! 1
Copy part of text file 4
Finding specific excel files 2
modification of auto-multiple workbook macro, Ron DeBruin (Copy4) 10

Back
Top