问:我想将一些2列数据复制到另一张特定范围的表格中。请帮忙。提前谢谢。
Sub cutpaste()
Range("c5:d7").Cut Sheets("C:\Users\Sai\Desktop\Anil peddi\Practice.xlsm\sheet2")range("f5")
End Sub
答案 0 :(得分:1)
Sub myMacro()
' source
Dim wbkSour As Workbook
Set wbkSour = Workbooks("WorkBookNameWhereMacroIs.xlsm")
' destination
Dim wbkDest As Workbook
Set wbkDest = Workbooks.Open("C:\...\DestinationWorkBookName.xlsm")
' copying proccess
wbkDest.Sheets("Sheet2").Range("F5:G7").Value = wbkSour.Sheets("Sheet1").Range("C5:D7").Value
' save and close destination
wbkDest.Save
wbkDest.Close
End Sub