This is my guess work on what you are trying to do.
You should have master book with sheet1 as a destination sheet. Sheet1 has also a header.
Sub Collect_Data()
Dim DstWks1 As Worksheet, DstWks2 As Worksheet, LastRow As Long, NR As Long, SrcWkb As Workbook, StartRow As Long
Dim wkbname As Variant
Dim xlsFiles As Variant
Application.ScreenUpdating = 0
'Set references to destination workbook worksheet objects
Set DstWks1 = ThisWorkbook.Worksheets("Sheet1")
Set DstWks2 = ThisWorkbook.Worksheets("Sheet2")
'Starting row on source worksheet
StartRow = 1
'Get the workbooks to open GetOpenFilename
xlsFiles = Application.GetOpenFilename(FileFilter:="Excel files (*.xls*),*.xls*", MultiSelect:=True) 'Excel files (*.xls),
Application.AskToUpdateLinks = False
If VarType(xlsFiles) = vbBoolean Then Exit Sub
'Loop through each workbook and copy the data to this workbook
For Each wkbname In xlsFiles
Set SrcWkb = Workbooks.Open(fileName:=wkbname, ReadOnly:=True)
With SrcWkb.Worksheets(2)
LastRow = .Cells(.Rows.Count, "D").End(xlUp).Row
.Range("A2:D" & LastRow).Copy
NR = DstWks1.Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1
DstWks1.Range("A" & NR).PasteSpecial xlValues
End With
Application.ScreenUpdating = True
SrcWkb.Close SaveChanges:=False
''SrcWkb.Close''
Next wkbname
End Sub
Bookmarks