# Create a custom merge cells tool

## Environment

<table>
    <tbody>
	    <tr>
	    	<td>Product Version</td>
	    	<td>8.2.0</td>
	    </tr>
	    <tr>
	    	<td>Product</td>
	    	<td>Progress® KendoReact Spreadsheet</td>
	    </tr>
    </tbody>
</table>

## Description

How can I create a custom tool that merges the selected cells in the KendoReact Spreadsheet?

## Solution

This can be achieved by adding a custom button, `MergeCellsButton`, to the tools array in the [toolbar](https://www.telerik.com/kendo-react-ui/components/spreadsheet/api/spreadsheetprops#toolbar) prop of the Spreadsheet. Inside the `MergeCellsButton`, use the Spreadsheet's ref to access the active sheet, retrieve the selected cells with the `selection` method, and then merge them using the `merge` method.

[Demo Source](https://demos.telerik.com/kendo-react-ui/knowledge-base/spreadsheet/spreadsheet-merge-cells-tool/source.txt)
