ITabRange.ExtendToAdjacentCells

Syntax

ExtendToAdjacentCells: ITabRange;

Description

The ExtendToAdjacentCells method returns the range of cells obtained by extending the current one to adjacent non-empty cells.

Example

Var
    TSheet: ITabSheet;
    TSel: ITabSelection;
    TRange1, TRange2: ITabRange;
Begin
    TSheet := //Get table parameters
    TSel := TSheet.View.Selection;
    //Get selected range
    TRange1 := TSel.Range;
    //Expand range
    TRange2 := TRange1.ExtendToAdjacentCells;
    //Select obtained range in the table
    TSel.Range := TRange2;

Clicking the button returns currently selected table range. This range is expanded to include all non-empty adjacent cells. The resulting range is selected in the table.

Source table with the selected cell A0:

Selected range obtained as a result of the ExtendToAdjacentCells method:

See also:

ITabRange