Spread 8.0 Documentation
ClearRange Method
Support Options
ActiveX Reference > ActiveX Methods > ClearRange Method

Glossary Item Box

ClearRange Method


See Also    DLL    Example

Applies To

fpSpread control

Description

Clears the data or the data and formatting from a cell, a block of cells, a column, a row, or the entire sheet.

Syntax

C++

void CSpreadSheet::ClearRange(long lCol, long lRow, long lCol2, long lRow2, BOOL bDataOnly);

Visual Basic

fpSpread1.ClearRange(ByVal lCol As Long, ByVal lRow As Long, ByVal lCol2 As Long, ByVal lRow2 As Long, ByVal bDataOnly As Boolean)

Parameters

The following parameters are available:

Parameter Description
lCol Column number of top-left cell in block to clear
lRow Row number of top-left cell in block to clear
lCol2 Column number of bottom-right cell in block to clear
lRow2 Row number of bottom-right cell in block to clear
bDataOnly Determines whether the clear deletes data or data and formatting

Remarks

Use the ClearRange method to delete the data, notes, and formulas and to clear the formatting from a cell, a column, a row, a block of cells, or the entire sheet, or to delete just the data. If you choose to delete the data and formatting, the formatting is reset to the default values for the cell, column, row, block, or sheet. For example, if you clear a cell with a blue background but the cell column's background is red, the cell's background becomes red after you clear the cell.

This method is called for the current sheet setting unless you first set the Sheet property to specify the sheet with which you want to work.

Cell-related information (for example, text, font, background color, text color, and cell type) is stored in one of four locations.

When applied to a block of cells, the ClearRange method works with only the information in the cell itself. If you set the Col or Row parameter to –1 to write data, no information is stored in the cell itself and the ClearRange method is ignored. For more information, see Precedence of Settings.

Return Type

None

See Also

Sheet property

CopyRange, MoveRange, Reset, ResetSheet, SwapRange methods

DLL Correspondence

SSClearRange function

Copyright © GrapeCity, inc. All rights reserved.