PasteInRangeEx(
Range: ITabRange;
PasteMode: TabPasteMode;
[SkipEmptyCells: Boolean = False];
[Transpose: Boolean = False]);
Range. The range, to which paste is executed.
PasteMode. Insert mode.
SkipEmptyCells. Indicates whether empty cells are skipped.
Transpose. Indicates whether data should be transposed on insert.
The PasteInRangeEx method pastes special data from the clipboard to the specified cell range area.
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.
If the inserted range contains empty cells, and the SkipEmptyCells parameter is set to True, formulas, formatting and comments are not inserted for these cells.
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.PasteInRangeEx(TSheet.ParseRange("E0:G0"), TabPasteMode.Values);
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 special paste is executed to the E0:G0 cell range, that is, only the values corresponding to the partially copied A0:C0 range will be pasted.
See also: