参考代码,如 (ws1、ws2拷贝到ws3中去)
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("D:\test.xls")
Dim Ws1 As MSExcel.WorkSheet = Wb.WorkSheets("sheet1") '指定要复制的工作表
Dim Ws2 As MSExcel.WorkSheet = Wb.WorkSheets("sheet2")
Dim Ws3 As MSExcel.WorkSheet = Wb.WorkSheets("sheet3")
Ws1.UsedRange.Copy
ws3.Cells(1,1).Select
ws3.paste
Ws2.UsedRange.Copy
'ws3.Cells(1,Ws1.UsedRange.Columns.Count).Select '横向拷贝
ws3.Cells(Ws1.UsedRange.Rows.Count,1).Select '纵向拷贝
ws3.paste
'Wb.Save
app.Visible = True
'App.Quit