XL.Sheet.DelMergeByIndex
------------------------

Removes merged cells by index.

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

MBS( "XL.Sheet.DelMergeByIndex"; BookRef; SheetIndex; Index ) 

**MBS**( **"XL.Sheet.DelMergeByIndex";** /\* Removes merged cells by index. \*/  
**$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 \*/   
**$Index**) /\* The index of the hyperlink. From 0 to [XL.Sheet.MergeSize](XLSheetMergeSize.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 |
| Index | The index of the hyperlink. From 0 to [XL.Sheet.MergeSize](XLSheetMergeSize.md)-1. | 0 |

### Result

Returns OK or error.

### Description

Removes merged cells by index.  
### Examples

Try the delete merge function:

 # check how many we have   
Show Custom Dialog \[ "Merge count" ; MBS ( "[XL.Sheet.MergeSize](XLSheetMergeSize.md)"; $bookRef ; 0 ) \]   
\# where is first one?   
Set Variable \[ $FirstMergeRowFirst ; Value: MBS ( "[XL.Sheet.Merge](XLSheetMerge.md)"; $bookRef ; $sheet ; 0; "RowFirst" ) \]   
Set Variable \[ $FirstMergeColFirst ; Value: MBS ( "[XL.Sheet.Merge](XLSheetMerge.md)"; $bookRef ; $sheet ; 0; "ColFirst" ) \]   
Show Custom Dialog \[ "First merge at" ; $FirstMergeRowFirst &amp; " " &amp; $FirstMergeColFirst \]   
\# now delete first in line   
Set Variable \[ $r ; Value: MBS ( "XL.Sheet.DelMergeByIndex"; $bookRef ; $sheet ; 0 ) \]   
\# new count is lower   
Show Custom Dialog \[ "Merge count" ; MBS ( "[XL.Sheet.MergeSize](XLSheetMergeSize.md)"; $bookRef ; 0 ) \]   
\# and this is now the next one   
Set Variable \[ $FirstMergeRowFirst ; Value: MBS ( "[XL.Sheet.Merge](XLSheetMerge.md)"; $bookRef ; $sheet ; 0; "RowFirst" ) \]   
Set Variable \[ $FirstMergeColFirst ; Value: MBS ( "[XL.Sheet.Merge](XLSheetMerge.md)"; $bookRef ; $sheet ; 0; "ColFirst" ) \]   
Show Custom Dialog \[ "First merge at" ; $FirstMergeRowFirst &amp; " " &amp; $FirstMergeColFirst \]  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.Merge](XLSheetMerge.md)
- [XL.Sheet.MergeSize](XLSheetMergeSize.md)

This function checks for a license.

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

  
[XL.Sheet.DelHyperlink](XLSheetDelHyperlink.md) - [XL.Sheet.DeleteMerge](XLSheetDeleteMerge.md)

[HTML Version](XLSheetDelMergeByIndex.shtml)