Paste Method
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Paste Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

Pastes the contents of the Clipboard onto the sheet. If you don’t specify the Destination argument, you must select the destination range before you use this method.

expression.Paste(Destination, Link)

expression   Required. An expression that returns a Worksheet object.

Destination  Optional Variant. A Range object that specifies where the Clipboard contents should be pasted. If this argument is omitted, the current selection is used. This argument can be specified only if the contents of the Clipboard can be pasted into a range.

Link  Optional Variant.  Not supported in this version of the Spreadsheet component.

Pastes the Clipboard contents into the specified range.


expression   An expression that returns a Range object.


This example copies cells A1:D10 on Sheet1 and pastes starting at cell A1 in Sheet2.

Sub PasteData()

    ' Copy cell A1:D10 in Sheet1.

    ' Paste starting at cell A1 of Sheet2.

End Sub

This example pastes the contents of cell A1 into cells A3, A5, and A7.

Sub PasteRange()

    Dim iRowNum

    ' Copy cell A1 on the active worksheet.

    ' Loop through the odd numbers from 3 to 7.
    For iRowNum = 3 To 7 Step 2
        ' Paste the copied cell.
        Spreadsheet1.ActiveSheet.Cells(iRowNum, 1).Paste

End Sub


© 2016 Microsoft