I know very similar questions have previously been asked and I have tried to follow them without success. When I run this I get a Run-time error '1004' msg.
The 'CopySheets' Macro is saved in the 'ToWorkbook'
Thanks
Sub CopySheets()
Dim FromWorkbook As Workbook
Dim ToWorkbook As Workbook
Set FromWorkbook = Workbooks("FromWorkbook.xlsm")
Set ToWorkbook = Workbooks("ToWorkBook.xlsm")
Dim FromSheet As Worksheet
For Each FromSheet In FromWorkbook.Sheets
FromSheet.Copy After:=ToWorkbook.Sheets(ToWorkbook.Sheets.Count)
Next
End Sub
The 'CopySheets' Macro is saved in the 'ToWorkbook'
Thanks
Sub CopySheets()
Dim FromWorkbook As Workbook
Dim ToWorkbook As Workbook
Set FromWorkbook = Workbooks("FromWorkbook.xlsm")
Set ToWorkbook = Workbooks("ToWorkBook.xlsm")
Dim FromSheet As Worksheet
For Each FromSheet In FromWorkbook.Sheets
FromSheet.Copy After:=ToWorkbook.Sheets(ToWorkbook.Sheets.Count)
Next
End Sub