Can you adapt this one
Option Explicit
Sub ConsolidateSheetsFromWorkbooks()
'Author: Jerry Beaucaire, ExcelForum.com
'Date: 1/5/2011
'Summary: Open all files in a folder and merge data (stacked) on all
' sheets into main wb matching the sheet names.
' Assumes all sheets with titles exist in main book and
' data sheets data starts at row 2
Dim wbData As Workbook, wbMain As Workbook
Dim wsMain As Worksheet, wsData As Worksheet
Dim LR As Long, NR As Long
Dim fPath As String, fName As String
Set wbMain = ThisWorkbook
'if files are stored in separate directory edit fPath
fPath = ThisWorkbook.Path & "\" 'don't forget the final \
fName = Dir(fPath & "*.xls") 'start looping through files one at a time
Application.ScreenUpdating = False
Do While Len(fName) > 0
If fName <> ThisWorkbook.Name Then
Set wbData = Workbooks.Open(fPath & fName)
For Each wsData In wbData.Worksheets
Set wsMain = wbMain.Sheets(wsData.Name)
NR = wsMain.Range("A" & Rows.Count).End(xlUp).Row + 1
With wsData
LR = .Range("A" & .Rows.Count).End(xlUp).Row
.Range("A2:A" & LR).EntireRow.Copy wsMain.Range("A" & NR)
End With
Next wsData
wbData.Close False
End If
fName = Dir 'queue up next filename
Loop
Application.ScreenUpdating = True
End Sub
Bookmarks