Sub autocopy4()
Dim filesystem As Object, myfolder As Object
Dim myfiles As Object, myfile As Object, Pastefile As Object
On Error Resume Next
Set filesystem = CreateObject("Scripting.filesystemobject")
Set myfolder = filesystem.getfolder("Folder that holds all the files you want to open")
Set myfiles = myfolder.Files
Set Pastefile = filesystem.getfile("File that you want the data captured in")
Workbooks.Open Filename:="Data capture file"
For Each myfile In myfiles
Workbooks.Open Filename:=myfolder & "\" & myfile.Name
Rownum = ActiveSheet.UsedRange.Rows.Count
Windows(Pastefile.Name).Activate
Lastrow = ActiveSheet.UsedRange.Rows.Count
If Lastrow = 1 Then
Else: Lastrow = Lastrow + 1
End If
Workbooks(myfile.Name).Worksheets("Sheet1").Range("A1:A" & Rownum).EntireRow.Copy Destination:=Cells(Lastrow, 1)
Windows(myfile.Name).Activate
Application.CutCopyMode = False
ActiveWindow.Close
Next
End Sub