Hi all,

I am trying to write a macro to open a file within a folder. All the files in this folder have the same name, except the date at the end of them is different. There is no consistency to how often these reports are generated, so I need to just open the file with the latest date. I also cannot use the most recently opened / edited because we often have to look back at these files. Currently using this code and changing the date every day until I can figure this out lol:

Sub GetEmployeeCount()

ScreenUpdating = False

Dim sOpenLastReport As String

sOpenLastReport = "H:\Desktop\BA.com Daily Production Reports\06-15\BA.com_ProductionReport_06-07-15.xlsm"
    Workbooks.Open Filename:= _
        sOpenLastReport
Sheets("EmployeeCount").Visible = True
Sheets("EmployeeCount").Select
Range("B4:Z17").Copy
ThisWorkbook.Activate
Sheets("EmployeeCount").Select
Range("C4").PasteSpecial Paste:=xlPasteValues
Workbooks("BA.com_ProductionReport_06-07-15.xlsm").Activate
Sheets("EmployeeCount").Select
Range("B35:Z35").Copy
ThisWorkbook.Activate
Sheets("EmployeeCount").Select
Range("C35").PasteSpecial Paste:=xlPasteValues
Workbooks("BA.com_ProductionReport_06-07-15.xlsm").Close

End Sub
thanks!