Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The following sample code first creates a range - A1:D4 - and then merges the cells in the range into a single cell using the Range.merge() method. Similarly, it is possible to split cells by creating a range and calling the Range.unMerge() method.
The following image shows the output Excel file generated with the sample code. As you can see, the range A1:D4 has been merged into a single cell.

Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.