Export (0) Print
Expand All
0 out of 8 rated this helpful - Rate this topic

Paste Method


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


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.