> For the complete documentation index, see [llms.txt](https://xlswriter-docs.viest.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xlswriter-docs.viest.me/english/cell/merge-cells.md).

# Merge cells

## **Function Prototype**

```php
mergeCells(string $scope, string $data[, resource $formatHandler]): self
```

### **string $scope**

> Cell range

### **string $data**

> Data

### **resource $formatHandler**

> cell style

## example

```php
$excel->fileName("test.xlsx")
   ->mergeCells('A1:C1', 'Merge cells')
   ->output();
```
