La saqué de esta misma página. Siempre tiene que ser la línea 5. y mientras se vaya agregando más archivos a la carpeta la información tendría que ir copiándose desde arriba sin borrar lo anterior ni dejar espacios.
Muchísimas gracias.
Sub libros()
'Lee archivos del directorio y Copia la hoja 1
'Por.Dam
Application.ScreenUpdating = False
ruta = ThisWorkbook.Path
ChDir ruta
archi = Dir("*.xls*")
Set h1 = ThisWorkbook.Sheets("hoja1")
h1.Cells.Clear
On Error Resume Next
ffin = h1.UsedRange.Find(what:="*").Row
ActiveCell.SpecialCells(xlLastCell).Select
On Error Resume Next
Do While archi <> ""
If InStr(1, archi, "nuevo") = 0 Then
Workbooks.Open archi
If Err.Number = 0 Then
Sheets(1).Select
Range(Range("A5:G5"), ActiveCell.SpecialCells(xlLastCell)).Copy _
h1.Range("A" & h1.Range("A1").SpecialCells(xlLastCell).Row + 1)
End If
Err.Number = 0
Application.DisplayAlerts = False
Workbooks(archi).Close
Application.DisplayAlerts = True
End If
archi = Dir()
Loop
End Sub