Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.58 KB

Excel.Range.PasteSpecial.md

File metadata and controls

55 lines (35 loc) · 1.58 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Range.PasteSpecial method (Excel)
vbaxl10.chm144238
vbaxl10.chm144238
Excel.Range.PasteSpecial
d3e991f2-7ef7-2ebc-d4bc-ba4c26be472e
05/11/2019
medium

Range.PasteSpecial method (Excel)

Pastes a Range object that has been copied 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, 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.

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.

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

[!includeSupport and feedback]