Excel 2003复制工作表

时间:2013-09-08 13:32:31

标签: excel vba

我有两个xls文件:file1.xls和file2.xls

我想将文件“file1.xls”的sheet1的内容复制到文件“file2.xls”的sheet2中。

1 个答案:

答案 0 :(得分:0)

考虑类似的事情:

Sub dural()
    Dim alpha As Workbook, beta As Workbook
    Workbooks.Open Filename:="C:\TestFolder\alpha.xlsm"
    Set alpha = ActiveWorkbook
    Workbooks.Open Filename:="C:\TestFolder\beta.xlsm"
    Set beta = ActiveWorkbook
    alpha.Sheets(1).Copy Before:=beta.Sheets(1)
End Sub