XL.Sheet.MergeSize
------------------

Returns a number of merged cells in this worksheet.

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

MBS( "XL.Sheet.MergeSize"; BookRef; SheetIndex ) 

**MBS**( **"XL.Sheet.MergeSize";** /\* Returns a number of merged cells in this worksheet. \*/  
**$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 \*/ 

### 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 |

### Result

Returns number or error.

### Description

Returns a number of merged cells in this worksheet.  
### Examples

Show how many merges there are:

 Show Custom Dialog \[ "Merge count" ; MBS ( "XL.Sheet.MergeSize"; $bookRef ; 0 ) \]  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.DelMergeByIndex](XLSheetDelMergeByIndex.md)
- [XL.Sheet.Merge](XLSheetMerge.md)
- [XL.Sheet.TableSize](XLSheetTableSize.md)

This function checks for a license.

Created 18th August 2014 , last changed 10th May 2023

  
[XL.Sheet.Merge](XLSheetMerge.md) - [XL.Sheet.NamedRange](XLSheetNamedRange.md)

[HTML Version](XLSheetMergeSize.shtml)