View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] scott.k@ems-t.com is offline
external usenet poster
 
Posts: 1
Default Selecting the most recent file in a folder by Macro/VBA script

My spreadsheet has a macro that currently auto opens a file with a
specified name from a specified location then takes a series of
actions. I'd like to have a script that will go to the folder and open
the most recent file, regardless of what it is named. Any advice is
appreciated!

Here is the part of the macro that currently opens the file and brings
over info to the active workbook:

Workbooks.Open Filename:= _
"H:\DOWNLOAD\CURRENT\Download for Workup\ForWorkup.xls"
Sheets("DOWNLOAD CURRENT EMPLOYEES 3").Copy Befo=Workbooks( _
"Workup Template.xls").Sheets(3)
Windows("ForWorkup.xls").Activate
ActiveWorkbook.Close