NamedRange::Copy Method (Object^)

 

Copies the contents of the NamedRange control to the specified range or to the Clipboard.

Namespace:   Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Object^ Copy(
	Object^ Destination
)

Parameters

Destination
Type: System::Object^

Specifies the new range to which the contents of the NamedRange control will be copied. If this argument is omitted, Microsoft Office Excel copies the range to the Clipboard.

Return Value

Type: System::Object^

For information on optional parameters, see Optional Parameters in Office Solutions.

The following code example uses the Copy method to copy the contents of a NamedRange control named NamedRange1 to the Clipboard, and then uses the PasteSpecial method to paste these contents into a NamedRange control named NamedRange2. The Operation parameter is set to xlPasteSpecialOperationAdd so that the content of each cell in NamedRange1 is added to the corresponding cell in NamedRange2.

This example is for a document-level customization.

No code example is currently available or this language may not be supported.
Return to top
Show: