Sub Importer()
Dim objShell As Object, objFolder As Object
Dim Chemin As String, Fichier As String, Feuil As String, valPlage As String
Dim i As Integer
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(&H0&, "Choisir un répertoire", &H1&)
If objFolder Is Nothing Then
MsgBox "Abandon opérateur", vbCritical, "Annulation"
Else
Chemin = objFolder.ParentFolder.ParseName(objFolder.Title).Path & "\"
Fichier = Dir(Chemin & "*.xls")
Do While Len(Fichier) > 0
If Fichier <> ThisWorkbook.Name Then
valPlage = Range(Cells(1, 1), Cells(Range("A65536").End(xlUp).Row, _
Range("IV1").End(xlToLeft).Column)).Address
ThisWorkbook.Names.Add "Plage", _
RefersTo:="='" & Chemin & "[" & Fichier & "]Feuil'!" & valPlage
With Sheets(2)
.[valPlage] = "=Plage"
.[valPlage].Copy
While i <= 0
Sheets(1).Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
i = i + 1
Wend
Sheets(1).Range("A" & Rows.Count).End(xlUp).Offset(0, 0).PasteSpecial xlPasteValues
End With
End If
Fichier = Dir()
Loop
End If
End Sub