Bonjour à tous,
Le second me semble plus approprié déjà pour manipuler des fichiers. Dans l'énoncé, il est question des noms de fichier dans une colonne. Il faudrait penser la boucle à partir de ce point.
Voici un essai :
Sub transfert()
dim wsDest as worksheet, nvl&
Set wsDest = ThisWorkbook.Worksheets("Feuil2")
For i = 1 to sheets("feuilleavecreps").range("quicontientreps").rows.count
nvl = wsDest.usedrange.rows.count + wsDest.usedrange.row
with Workbooks.Open(ThisWorkbook.Path & "\" & .cells(i, 1).value & ".xlsx")
with .activesheet.usedrange
wsDest.cells(nvl, 1).resize(.rows.count, .columns.count).value = .value
end with
.close true
end with
Next i
end sub
Cdlt,