Link Search Menu Expand Document

SSpread.GetSelection Method

Explanation Returns one of the selected cell blocks on the spreadsheet.

Gets the selected cell blocks if the user is allowed to select multiple cell blocks (if the AllowMultiBlocks property is $TRUE).
The index of the cell block is specified in the argument index. Cell block indexes are assigned serial numbers starting from 0, starting with the largest block.

The total number of selected cell blocks can be obtained with the SelectionCount property.

Use the AddSelection method to add a selected cell block.
Call format GetSelection(index)
Return value Record object with the following child objects
Type Name Description
Number Col Leftmost column number of the selected cell block
Number Row Row number at the top of the selected cell block
Number Col2 Rightmost column number of the selected cell block
Number Row2 Row number at the bottom of the selected cell block
Arguments index Cell block index number
Exception None
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, SelectionCount property
AddSelection method