XL.Sheet.AreCellsEmpty
----------------------

Checks whether the cells in the given range are empty.

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

MBS( "XL.Sheet.AreCellsEmpty"; BookRef; SheetIndex; First row; Last row; First column; Last column ) 

**MBS**( **"XL.Sheet.AreCellsEmpty";** /\* Checks whether the cells in the given range are empty. \*/  
**$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 \*/   
**$First row**; /\* The first row to process. First row has index 0.e.g. 3 \*/   
**$Last row**; /\* The last row to process. First row has index 0.e.g. 6 \*/   
**$First column**; /\* The first column to process. First column has index 0.e.g. 2 \*/   
**$Last column**) /\* The last column to process. First column has index 0.e.g. 4 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| 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 |
| First row | The first row to process. First row has index 0. | 3 |
| Last row | The last row to process. First row has index 0. | 6 |
| First column | The first column to process. First column has index 0. | 2 |
| Last column | The last column to process. First column has index 0. | 4 |

### Result

Returns 1, 0 or error.

### Description

Checks whether the cells in the given range are empty.  
If one of the cell has a text (even empty) or number, the return is zero.  
### Examples

Find empty rows:

 Set Variable \[ $sheet ; Value: 0 \]   
Set Variable \[ $lastCol ; Value: 7 \]   
Set Variable \[ $firstCol ; Value: 0 \]   
Set Variable \[ $count ; Value: MBS ( "[XL.Sheet.GetLastRow](XLSheetGetLastRow.md)"; $bookRef ; $sheet ) \]   
Set Variable \[ $index ; Value: 1 \]   
Set Variable \[ $EmptyRows ; Value: "" \]   
If \[ $index ≤ $count \]   
 Loop  
 # your script steps here  
 Set Variable \[ $row ; Value: $index \]   
 Set Variable \[ $r ; Value: MBS ( "XL.Sheet.AreCellsEmpty"; $bookRef ; $sheet ; $row ; $row ; $firstCol ; $lastCol ) \]   
 If \[ $r \]   
 Set Variable \[ $EmptyRows ; Value: $EmptyRows &amp; $row &amp; ¶ \]   
 End If  
 #   
 # next  
 Set Variable \[ $index ; Value: $index + 1 \]   
 Exit Loop If \[ $index &gt; $count \]   
 End Loop  
End If  
Show Custom Dialog \[ "Empty rows" ; $EmptyRows \]  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.GetLastRow](XLSheetGetLastRow.md)

### Release notes

- **Version 13.2**
    - Added [XL.Sheet.AreCellsEmpty](https://www.mbsplugins.eu/XLSheetAreCellsEmpty.shtml) function.

### Blog Entries

- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.2pr1](https://www.mbsplugins.de/archive/2023-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 30th March 2023 , last changed 31st March 2023

  
[XL.Sheet.ApplyFilter](XLSheetApplyFilter.md) - [XL.Sheet.AutoFilter](XLSheetAutoFilter.md)

[HTML Version](XLSheetAreCellsEmpty.shtml)