我需要将摘要工作表从12个不同的工作簿复制到区域工作簿中。我在应将工作表复制到区域工作簿的行上收到调试错误。我尝试在源工作簿和当前工作簿上同时使用名称和工作表编号。该代码包含在下面。
Sub copyfc()
Dim sourceworkbook As Workbook
Dim currentworkbook As Workbook
Set currentworkbook = ThisWorkbook
Set sourceworkbook = Workbooks.Open("C:\Country Files\BE FC12 BU19.xlsx")
sourceworkbook.Sheets("BE").Copy after:=currentworkbook.Sheets("End")
sourceworkbook.Close
End Sub
答案 0 :(得分:0)
下面的行将工作表放在最后:
sourceworkbook.Sheets("BE").Copy After:=currentworkbook.Sheets(currentworkbook.Sheets.Count)