I have a folder in which all the filenames have a set format: 000-YYMMDD, where 000 is an index number, and YYMMDD represents a date.
I want a macro to check the folder for incorrect filenames. I’m using the following to check the date:
Code: Select all
dDate = Mid(xName, 5, 6)
dDate2 = Mid(dDate, 3, 2) & "/" & Right(dDate, 2) & "/20" & Left(dDate, 2)
If Not IsDate(dDate2) Then …
How can I get the IsDate function to identify incorrect dates?