ITabSheet.PasteInRange

Syntax

PasteInRange(Range: ITabRange);

Parameters

Range. The range, to which paste is executed.

Description

The PasteInRange method pastes data from the clipboard to the specified cell range area.

Comments

Paste is executed only to the area of the Range range without filling neighbor ranges. The currently selected range is taken into account during the paste. If start point of the selection matches with the start of the Range range, copied data corresponding to the size of the Range range is pasted to the range. If the start point of the selected range differs from the Range range, the corresponding shift by cells will be created during the paste.

Example

Executing the example requires a form with the Button1 and Button2 buttons located on it, the UiTabSheet component named UiTabSheet1 and the TabSheetBox component.

Add links to the Tab system assembly.

Class TESTForm: Form
    Button1: Button;
    Button2: Button;
    UiTabSheet1: UiTabSheet;
    TabSheetBox1: TabSheetBox;
    TSheet: ITabSheet;

    Sub TESTFormOnCreate(Sender: Object; Args: IEventArgs);
    Begin
        TSheet := UiTabSheet1.TabSheet;
    End Sub TESTFormOnCreate;
    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Begin
        TSheet.View.Selection.Range := TSheet.ParseRange("A0:C2");
        TSheet.Copy;
    End Sub Button1OnClick;
    Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
    Begin
        TSheet.View.Selection.Range := TSheet.ParseRange("E0");
        TSheet.PasteInRange(TSheet.ParseRange("E0:G0"));
    End Sub Button2OnClick;
End Class TESTForm;

Clicking the Button1 button copies data of the A0:C2 range to the clipboard. Clicking the Button2 button selects the E0 cell, and the data corresponding to partially copied range (A0:C0) will be pasted to the E0:G0 cell range.

See also:

ITabSheet