Private Sub Macro2()
Dim TheFileSearcher
TheFileSearcher = ActiveWorkbook.Path
Dim i As Integer
On Error Resume Next
Set TheFileSearcher = Application.FileSearch
With TheFileSearcher
.NewSearch
.Filename = "*.xls*"
.LookIn = ActiveWorkbook.Path
.SearchSubFolders = False
.Execute msoSortByFileName, msoSortOrderAscending
If .Execute > 0 Then
With .FoundFiles
For i = 1 To .Count
If ThePath & Dir(.Item(i)) = "uptdate_recap.xls" Then GoTo suivant
Cells(i, 1).Value = ThePath & Dir(.Item(i))
suivant:
Next i
End With
Else
MsgBox "Pas de Fichier trouvéé dans " & ThePath
End If
End With
Set TheFileSearcher = Nothing
'trie
Columns("A:A").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1").Select
End Sub