Skip to main content

TdxSpreadSheetTableView.ClearCells(string,TdxSpreadSheetTableViewClearCellsOptions) Method

Clears the specified cell range.

Declaration

procedure ClearCells(const AArea: string; AOptions: TdxSpreadSheetTableViewClearCellsOptions); overload;

Parameters

Name Type
AArea string
AOptions TdxSpreadSheetTableViewClearCellsOptions

Remarks

You can call any of these overloaded procedure variants to clear a cell or cell range. Different ClearCells procedure variants provide different ways to specify the target area and actual operations that a cell clear operation involves:

Variant

Target Area

Clear Operations

1

The first and second procedure variants accept a TRect value as the AArea parameter. The value indicates the target cell range. A ClearCells procedure call raises the EdxSpreadSheetCannotChangePartOfArrayError exception if the cell range intersects the area occupied by an array formula result.

The first procedure variant clears all cell values within the target area, restores the default cell style, and deletes all hyperlinks whose hot areas intersect the target area.

You can pass False as the optional:

  • AClearValues parameter to retain the stored values and related hyperlinks.
  • AClearFormats parameter to retain custom cell formatting in the target area.

This procedure variant never releases any underlying cell objects within the target area. Call the second or third overloaded ClearCells procedure variant or a DeleteCells procedure variant to destroy these cell objects.

2

The second overloaded procedure variant accepts a set of individual cell clear operation flags as the AOptions parameter. This procedure variant can delete comment containers associated with the cleared cells and destroy underlying cell objects within the target area in addition to the operations that the first and third overloaded procedure variants can do. Refer to the TdxSpreadSheetTableViewClearCellsOption type description for detailed information on all available cell clear operations.

3

The third and fourth procedure variants accept a reference (as a string in the A1 format) to the cleared cell or cell range. A ClearCells procedure call raises the EdxSpreadSheetError exception if the specified reference includes an error or does not correspond to a valid cell or cell range.

Like the first overloaded procedure, the third variant clears all cell values within the target area, restores the default cell style, and deletes all hyperlinks whose hot areas intersect the target area.

Likewise, the third procedure variant never frees any underlying cell objects and has identical AClearValues and AClearFormats optional parameters.

4

Like the second overloaded procedure, the fourth variant accepts a set of individual cell clear operation flags as the AOptions parameter. Refer to the TdxSpreadSheetTableViewClearCellsOption type description for details.

Note

A ClearCells procedure call has no effect if the CanClearCells function returns False.

See Also