我在同一个Excel里面,想把sheet1里面的内容全部复制到sheet2里面,用下面的代码怎么不能实现啊? With xlapp.ActiveWorkbook
.Sheets(1).Select
.Sheets(1).Cells.Select
.Selection.Copy
.Sheets(2).Select
.ActiveSheet.Paste
End With
请大家帮忙帮忙
.Sheets(1).Select
.Sheets(1).Cells.Select
.Selection.Copy
.Sheets(2).Select
.ActiveSheet.Paste
End With
请大家帮忙帮忙
Application.Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste其中Sheet1和Sheet2是两个Sheet的标签。
Cells.Select
Selection.Copy
Sheets("Sheet2").Select
Cells.Select
ActiveSheet.Paste你用EXCEL录制宏嘛
把代码改一下就行了
Dim i, j As Integer
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Open App.Path & "\test.xls"
xlApp.Visible = True
With xlApp
i = .Sheets(1).Cells.SpecialCells(xlCellTypeLastCell).Row
j = .Sheets(1).Cells.SpecialCells(xlCellTypeLastCell).Column
.Range(.Sheets(1).Cells(i, 1), .Sheets(1).Cells(1, j)).Select
.Selection.Copy
.Sheets(2).Select
.ActiveSheet.Paste
End With