Syncfusion.XlsIO.Base
Example 


Represents the destination Range to copy.

CopyTo(IRange) Method

Copies the Range to the specified Range (without updating formulas).
Syntax
'Declaration
 
Overloads Function CopyTo( _
   ByVal destination As IRange _
) As IRange
'Usage
 
Dim instance As IRange
Dim destination As IRange
Dim value As IRange
 
value = instance.CopyTo(destination)

Parameters

destination
Represents the destination Range to copy.

Return Value

Returns the copied Range.
Example
The following code illustrates how to copy the Range.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet sheet = workbook.Worksheets[0];
            
// Copying a Range �A1� to �A5�.
IRange source = sheet.Range["A1"];
IRange destination = sheet.Range["A5"];
source.CopyTo(destination);
            
workbook.Version = ExcelVersion.Excel2013;
workbook.SaveAs("CopyRange.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.3460.0.29

See Also