[COLOR="Red"]'Comment ouvrir dans un répertoire le dernier fichier modifié ?
'Largement inspiré d'une macro de Frédéric Sigoneau :[/COLOR]
Sub dernier_modifie()
Application.ScreenUpdating = False
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fs = Application.FileSearch
Sheets.Add
With fs
.LookIn = "D:\Divers\excel"
.SearchSubFolders = True
.Execute
For Each f In .FoundFiles
Set File = FSO.GetFile(f)
Range("a1") = File.DateLastModified
Range("b1") = f
Range("a1").Insert Shift:=xlDown
Range("b1").Insert Shift:=xlDown
Next f
End With
Set FSO = Nothing
Set File = Nothing
Range("A1").Delete Shift:=xlUp
Range("b1").Delete Shift:=xlUp
Range(Range("a1"), Range("a1").End(xlDown)).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("b1").Select
plus_recent = ActiveCell
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Workbooks.Open plus_recent
End Sub