Range.PasteSpecial Method

Excel Developer Reference

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

Name Required/Optional Data Type Description
Paste Optional XlPasteType . The part of the range to be pasted.
Operation Optional XlPasteSpecialOperation . The paste operation.
SkipBlanks Optional Variant True to have blank cells in the range on the Clipboard not be pasted into the destination range. The default value is False.
Transpose Optional Variant True 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

See Also