View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default find latest date modified file

Use Dir( ) in a loop
You mean the filename represent dates ?
Parse the filename to extract a date part and compare to the newest
found so far.

Or you mean check the file date that the OS exposes ?
Similar to above but use FileDateTime( ).

NickHK

"Junior728" wrote in message
...
Hi ,

I am trying to write a macro that goes into the same folder directory and
searches for the latest modified file and open that workbook... the Dir is
"H:\My WorkStation\PRCD" , and the filename is named after PRCD and the

date
when the file is created....so each time a new worksheet will be created

by
date created.e..g. in the folder, these are the worksheet found:

PRCD052207.xls 'this is the most newest file looking at the "date

Modified:
PRCD041807.xls
and so on....

How can i write the macro to run this?