Sub Macro5()
'
' Macro5 Macro
'
'
Dim wbk As Workbook
Application.ScreenUpdating = False
Set wbk = Workbooks.Open("g:\Work\EU Personal Assignment.xlsx")
Range("O2:R2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Dashboard_for_Roshan.xlsm").Activate
Range("A65536").End(xlUp).Select
ActiveSheet.Paste
Windows("EU Personal Assignment.xlsx").Activate
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Windows("Dashboard_for_Roshan.xlsm").Activate
Range("E65536").End(xlUp).Select
ActiveSheet.Paste
Windows("EU Personal Assignment.xlsx").Activate
Range("AC2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Windows("Dashboard_for_Roshan.xlsm").Activate
Range("F65536").End(xlUp).Select
ActiveSheet.Paste
Call .wbk.Close(False) <- i get the error here
End Sub
在 excel 之前End(xlUp)
,我正在使用
Cells(Cells(Rows.Count, "A").End(xlUp).Row + 1, "A").Select
但我无法使用它粘贴数据。
编辑:错误是.
.wbk 之前的额外错误,但现在它替换了前一行数据,而我希望它将数据粘贴到最后使用的行下方。有什么建议吗?