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 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. Spreadsheet1.Sheets("Sheet1").Range("A1:D10").Copy ' Paste starting at cell A1 of Sheet2. Spreadsheet1.ActiveSheet.Paste Spreadsheet1.Sheets("Sheet2").Range("A1") 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. Spreadsheet1.ActiveSheet.Range("A1").Copy ' 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 Next End Sub