I am currently running a macro that uses a unique reference number every day. This specific number is contained in the most recent file from a folder. In order to illustrate this problem, I will give you an example.

Suppose that you are in a file directory

"File name2014-10-05-000011485"
"File name2014-10-04-000011475"
"File name2014-10-03-000011465"

In order to run my macro, I need to add the most RECENT reference number. As you can see, the file is always the same except for the last 4 numbers in the file name as well as the date. Everyday the last numbers in the file name increase by an amount of 5-10. As such, I was thinking of writing a code that would copy the last day's reference number and create a loop to find the most recent file.

I was thinking of doing something like:
Dim i as string
set i= 5 to 10

Could someone please enlighten me with regards to how I write to add a loop to the last day's number until it gets the most recent number?

Once I get that number, I would like to paste it in my excel sheet and use is as my new reference number and redo the exact same process the day after.

Thank you very much,
Mike