Link Search Menu Expand Document

SSpread.ClearRange Method

Explanation Specify a range to erase the data.

Remove data, formulas from cells, columns, rows, cell blocks, or the entire spreadsheet.

By specifying the argument dataonly, you can select whether to initialize the format (font, background color, text color, cell type, etc.) or delete only the data and formula.
Call format ClearRange(col, row, col2, row2, dataonly)
Return value None
Arguments col Column number of the upper left cell of the cell block to be erased
row Row number of the upper left cell of the cell block to be erased
col2 Column number of the lower right cell of the cell block to be erased
row2 Row number of the lower right cell of the cell block to be erased
dataonly $TRUE to erase only data, $FALSE to erase formatted data
Exception EXT-28 An error occurred in the ClearRange method
Example of use
    BlockMode = $TRUE;
    Col = 2;
    Row = 2;
    Col2 = 5;
    Row2 = 5;
    Text = "sample";
    BackColor = $GREEN;
    BlockMode = $FALSE;
    
    ClearRange(2, 2, 3, 3, $TRUE);
    ClearRange(4, 4, 5, 5, $FALSE);
    
Related item CopyRange, MoveRange, Reset, SwapRange methods