XL.Sheet.SetMerge
-----------------

Sets merged cells for range: rowFirst - rowLast, colFirst - colLast.

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

MBS( "XL.Sheet.SetMerge"; BookRef; SheetIndex; rowFirst; rowLast; ColFirst; ColLast ) 

**MBS**( **"XL.Sheet.SetMerge";** /\* Sets merged cells for range: rowFirst - rowLast, colFirst - colLast. \*/  
**$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**; /\* The first row for the area. First row has index 0.e.g. $row \*/   
**$rowLast**; /\* The last row for the area. First row has index 0.e.g. $row \*/   
**$ColFirst**; /\* The first column for the area. First column has index 0.e.g. $column \*/   
**$ColLast**) /\* The last column for the area. First column has index 0.e.g. $column+1 \*/ 

### 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 |
| rowFirst | The first row for the area. First row has index 0. | $row |
| rowLast | The last row for the area. First row has index 0. | $row |
| ColFirst | The first column for the area. First column has index 0. | $column |
| ColLast | The last column for the area. First column has index 0. | $column+1 |

### Result

Returns OK or error.

### Description

Sets merged cells for range: rowFirst - rowLast, colFirst - colLast.  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.GetMerge](XLSheetGetMerge.md)
- [XL.Sheet.SetColPx](XLSheetSetColPx.md)
- [XL.Sheet.SetFooter](XLSheetSetFooter.md)
- [XL.Sheet.SetHCenter](XLSheetSetHCenter.md)
- [XL.Sheet.SetHeader](XLSheetSetHeader.md)
- [XL.Sheet.SetName](XLSheetSetName.md)
- [XL.Sheet.SetPaper](XLSheetSetPaper.md)
- [XL.Sheet.SetRowPx](XLSheetSetRowPx.md)
- [XL.Sheet.SetVCenter](XLSheetSetVCenter.md)

### Example Databases

- [XL/Writing data](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Writing%20data.shtml#5ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 18th August 2014

  
[XL.Sheet.SetMarginTop](XLSheetSetMarginTop.md) - [XL.Sheet.SetName](XLSheetSetName.md)

[HTML Version](XLSheetSetMerge.shtml)