How to list recent files with VBA automatically and open the most recent file. This is required when we wish to perform actions like transferring data to the most recent file we have been working on. Watch the video:
Watch this video on YouTube.
Here;s the complete code to open the most recent file auotamically and the some code commented out to list all the recent used files in your worksheet:
Range(“A1”) = Application.RecentFiles(1).Name
‘Application.RecentFiles.Maximum = 5
‘For i = 1 To Application.RecentFiles.Count
‘Cells(i, 1) = Application.RecentFiles(i).Name
A downloadable sample file for practice: