Many thanks to Bob Phillips and Ivan for their help with picking up a file
with a date tag using code. (For some reason the listing has now disappeared)
I need to go a step further, I need the latest created file to be opened.
The code below shows how far I Have got:
Dim wb As Workbook
sPath = Application.DefaultFilePath & "\" & sFile
sfilename = "My File*.xls"
If Len(Dir(sPath & "\" & sfilename)) = 0 Then
MsgBox "No file"
Else
sfilename = sPath & "\" & Dir(sPath & "\" & sfilename)
Set wb = Workbooks.Open(sfilename)
End If
All the workbooks start with 'My File' and end with different dates & times,
and at the moment it only picks up the oldest file.
Again - any help greatly appreciated
John
Bookmarks