ITabRange.Clone

Syntax

Clone: ITabRange;

Description

The Clone method creates a copy of a cell range.

Comments

When this method is called a new cell range is created. Those properties that are common for the source range are copied and set for the new range.

Example

Executing the example requires a form that contains the Button component with the Button1 identifier, the TabSheetBox component with the TabSheetBox1 identifier and the UiTabSheet component with the UiTabSheet1 identifier. Specify the UiTabSheet1 as a data source for the TabSheetBox1 component.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    TSheet: ITabSheet;
    r, r1: ITabRange;
Begin
    TSheet := UiTabSheet1.TabSheet;
    r := TSheet.View.Selection.Range;
    r1 := r.Clone;  
    Debug.WriteLine("Address of selected cell range: " + r1.Address);
End Sub Button1OnClick;

On clicking the button the "r1" variable contains a copy of the selected range, the development environment console displays the address of the selected cell range.

See also:

ITabRange