Try the code below. Change the FOLDER name as required. Make sure yo
have a backslash at the end of the folder name. The Macro will give yo
an error if the data in cell A1 is not a valid name for a worksheet.
worksheet names can't be nothing and can't contain certain characters.
Sub copybooks()
Folder = "C:\temp\"
FName = Dir(Folder & "*.xls")
Do While FName <> ""
'open workbook
Set bk = Workbooks.Open(Folder & FName)
For Each sht In bk.Worksheets
With ThisWorkbook
sht.Copy after:=.Sheets(.Sheets.Count)
ActiveSheet.Name = sht.Range("A1")
End With
Next sht
bl.Close savechanges:=False
FName = Dir()
Loop
End Su