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

Range.PasteSpecial Method

Office 2007
Pastes a Range from the Clipboard into the specified range.

Syntax

expression.PasteSpecial(Paste, Operation, SkipBlanks, Transpose)

expression   A variable that represents a Range object.

Parameters

NameRequired/OptionalData TypeDescription
PasteOptionalXlPasteType. The part of the range to be pasted.
OperationOptionalXlPasteSpecialOperation. The paste operation.
SkipBlanksOptionalVariantTrue to have blank cells in the range on the Clipboard not be pasted into the destination range. The default value is False.
TransposeOptionalVariantTrue to transpose rows and columns when the range is pasted.The default value is False.

Return Value
Variant

Example

This example replaces the data in cells D1:D5 on Sheet1 with the sum of the existing contents and cells C1:C5 on Sheet1.

Visual Basic for Applications
With Worksheets("Sheet1")
    .Range("C1:C5").Copy
    .Range("D1:D5").PasteSpecial _
        Operation:=xlPasteSpecialOperationAdd
End With



Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.