The following code does successfully loop through all of thesheets in the directory however it does not paste to the next open row in thedestination sheet and instead clobbers the data in the same rows
Sub copydatafrommulttomaster()
Dim folderpath As String, Filepath As String, filename AsString
folderpath = "C:\Users\Stvcass\Documents\AA_HISTORY"
Filepath = folderpath & "*.xls*"
filename = Dir(Filepath)
Do While filename <> ""
If myfile = "activity Log.xlsm" Then
Exit Sub
End If
Workbooks.Open (folderpath & filename)
Application.DisplayAlerts = False
Range("AK4:AT15").Select
Range("AK4:AT15").Copy
'Application.DisplayAlerts = False
Activewookbook.Close
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1,0).Row
ActiveSheet.PasteDestination:=Worksheets("Sheet1").Range(Cells(erow, 1), Cells(erow,4))
filename = Dir
Loop
Application.DisplayAlerts = True
End Sub
Sub copydatafrommulttomaster()
Dim folderpath As String, Filepath As String, filename AsString
folderpath = "C:\Users\Stvcass\Documents\AA_HISTORY"
Filepath = folderpath & "*.xls*"
filename = Dir(Filepath)
Do While filename <> ""
If myfile = "activity Log.xlsm" Then
Exit Sub
End If
Workbooks.Open (folderpath & filename)
Application.DisplayAlerts = False
Range("AK4:AT15").Select
Range("AK4:AT15").Copy
'Application.DisplayAlerts = False
Activewookbook.Close
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1,0).Row
ActiveSheet.PasteDestination:=Worksheets("Sheet1").Range(Cells(erow, 1), Cells(erow,4))
filename = Dir
Loop
Application.DisplayAlerts = True
End Sub