Link Search Menu Expand Document

SSpread.AddSelection Method

Explanation Add a selection of cell blocks.

Adds a new cell block selection if the user is allowed to select multiple cell blocks (if the AllowMultiBlocks property is $TRUE).

To get the selected cell block, use the GetSelection method.
Call format AddSelection(col, row, col2, row2)
Return value None
Arguments col Leftmost column number of cell block
row Row number at the top of the cell block
col2 Rightmost column number of cell block
row2 Row number at the bottom of the cell block
Exception EXT-28 An error occurred in the AddSelection method
Example of use
    AllowMultiBlocks = $TRUE;
    AddSelection(2, 2, 4, 3);
    AddSelection(1, 5, 5, 5);
    AddSelection(2, 7, 4, 7);
    for (var n = 0; n < SelectionCount; n++) {
        var sel = GetSelection(n);
        print(sel.Col, sel.Row, sel.Col2, sel.Row2, "\n");
    }
    
Related item AllowMultiBlocks property
ClearSelection, GetSelection methods