Copy Paste - danielep71/VBA-PERFORMANCE GitHub Wiki

Home


There are different approaches to copying data in VBA. The most efficient is the direct copy action, missing out the Windows Clipboard.

Example:

Sub CopyPaste_Direct()
    Sheets(“Source”).Range(“A1:E10”).Copy Destination:=Sheets(“Destination”).Range(“A1”)
End Sub

This example above is far more efficient than the “clipboard” method below, which sends the copied items to the clipboard to be then pasted:

Sub CopyPaste_Clipboard()
    Sheets(“Source”).Range(“A1:E10”).Copy
    Sheets(“Destination”).Range(“A1”).PasteSpecial
    Application.CutCopyMode = False
End Sub

Home