title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Range.PasteSpecial method (Excel) |
vbaxl10.chm144238 |
|
|
d3e991f2-7ef7-2ebc-d4bc-ba4c26be472e |
05/11/2019 |
medium |
Pastes a Range object that has been copied into the specified range.
expression.PasteSpecial (Paste, Operation, SkipBlanks, Transpose)
expression A variable that represents a Range object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Paste | Optional | XlPasteType | The part of the range to be pasted, such as xlPasteAll or xlPasteValues. |
Operation | Optional | XlPasteSpecialOperation | The paste operation, such as xlPasteSpecialOperationAdd. |
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. |
Variant
This example replaces the data in cells D1:D5 on Sheet1 with the sum of the existing contents and cells C1:C5 on Sheet1.
With Worksheets("Sheet1")
.Range("C1:C5").Copy
.Range("D1:D5").PasteSpecial _
Operation:=xlPasteSpecialOperationAdd
End With
[!includeSupport and feedback]