Sub Test_OK_II()
Dim FolderName$, MyPath, wkbSource As Workbook, f As Worksheet
Dim dF As Worksheet, A_Copier As Range, Derl&
Set dF = ThisWorkbook.Sheets(1): dF.[A1:R1] = "X"
With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.Show
On Error Resume Next
FolderName = .SelectedItems(1)
Err.Clear
On Error GoTo 0
End With
MyPath = FolderName
If Right(MyPath, 1) <> "\" Then MyPath = MyPath & "\"
'Boucle sur l'ensemble des fichiers du répertoire
MyFile = Dir(MyPath & "*.xl?")
Do While Len(MyFile) > 0
Derl = dF.Cells(Rows.Count, 1).End(3).Row
Set wkbSource = Workbooks.Open(MyPath & MyFile)
'Avec le classeur ouvert ou qu'on vient d'ouvrir...
Application.DisplayAlerts = False
With wkbSource
On Error Resume Next
Set f = .Sheets(1)
Set A_Copier = f.Cells(1, 1).Resize(f.Cells(Rows.Count, 1).End(3).Row, 18)
With A_Copier
dF.Cells(Derl + 1, 1).Resize(.Rows.Count, .Columns.Count).Value = .Value
End With
.Close savechanges:=False
End With
Set wkbSource = Nothing
Set CopyRng = Nothing
'Et on passe au suivant
MyFile = Dir()
Loop
End Sub