XL.Sheet.Clear
--------------

Clears cells in specified area.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XL](component_XL.md) | [3.5](newinversion35.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XL.Sheet.Clear"; BookRef; SheetIndex { ; rowFirst; rowLast; ColFirst; ColLast } ) 

**MBS**( **"XL.Sheet.Clear";** /\* Clears cells in specified area. \*/  
**$BookRef**; /\* The reference number for the workbook.e.g. $ref \*/   
**$SheetIndex**; /\* The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1.e.g. 0 \*/   
**$rowFirst**; /\* Optional; The first row for the area. Default is 0. First row has index 0.e.g. $row \*/   
**$rowLast**; /\* Optional; The last row for the area. Default is 65535.e.g. $row \*/   
**$ColFirst**; /\* Optional; The first column for the area. Default is 0. First column has index 0.e.g. $column \*/   
**$ColLast**) /\* Optional; The last column for the area. Default is 255.e.g. $column \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| BookRef | The reference number for the workbook. | $ref |  |
| SheetIndex | The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1. | 0 |  |
| rowFirst | The first row for the area. Default is 0. First row has index 0. | $row | Optional |
| rowLast | The last row for the area. Default is 65535. | $row | Optional |
| ColFirst | The first column for the area. Default is 0. First column has index 0. | $column | Optional |
| ColLast | The last column for the area. Default is 255. | $column | Optional |

### Result

Returns OK or error.

### Description

Clears cells in specified area.  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)

This function checks for a license.

Created 18th August 2014 , last changed 9th July 2015

  
[XL.Sheet.CellWriteTexts](XLSheetCellWriteTexts.md) - [XL.Sheet.ClearPrintArea](XLSheetClearPrintArea.md)

[HTML Version](XLSheetClear.shtml)