Sub test()
MsgBox Most_Recent("D:\XL\Forum", "Démo")
End Sub
' ***** Auteur : Pierre - P56 : http://tatiak.canalblog.com/
Function Most_Recent(Rep As String, Nm As String) As Variant
Dim Rp As Object, Item As Object, Tf(1 To 1, 1 To 2) As Variant
Set Rp = CreateObject("Scripting.FileSystemObject").GetFolder(Rep)
For Each Item In Rp.Files
If InStr(Item.Name, Nm) > 0 And Item.DateLastModified > Tf(1, 2) Then
Tf(1, 1) = Item.Name
Tf(1, 2) = Item.DateLastModified
End If
Next Item
Most_Recent = Tf(1, 1)
Set Rp = Nothing
End Function