excel vba paste end code example

Example: excel vba paste end

Sub Paste_Other_Sheet_or_Book()

    'Cut or Copy and Paste to another worksheet
    Worksheets("sheet1").Range("A1").Copy Worksheets("sheet2").Range("B1") 'Copy
    Worksheets("sheet1").Range("A1").Cut Worksheets("sheet2").Range("B1") 'Cut

    'Cut or Copy and Paste to another workbook
    Workbooks("book1.xlsm").Worksheets("sheet1").Range("A1").Copy _ 
    Workbooks("book2.xlsm").Worksheets("sheet1").Range("B1") 'Copy
    Workbooks("book1.xlsm").Worksheets("sheet1").Range("A1").Cut _ 
    Workbooks("book2.xlsm").Worksheets("sheet1").Range("B1") 'Cut

    Application.CutCopyMode = False
End Sub

Tags:

Misc Example