I have a template workbook with tab names of "Extract 1, Extract 2, Extract 3" etc and a main Summary page that contains formulas that rely on all of these tabs. I also have a number of workbooks (22) that each contain one worksheet with a data extract in them. I need to be able to loop through these workbooks and copy the sheets over without the need to remove and insert a new tab (needs to use existing tabs). Initially I had this:
Sub GetSheets()
Path = "C:\Users\hill\Desktop\Summary Doc Output Files\Summary Doc Output Files\"
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=ThisWorkbook.Sheets(1)
Next Sheet
Workbooks(Filename).Close
Filename = Dir()
Loop
Dim x As Integer
End Sub
but this only inserts new tabs and does not use the existing tab structure in place.
Is there an easy way of doing this?