Merges the selected cells.
procedure MergeSelectedCells(AllowMergeRC: Boolean);
This method fails (does nothing) if the selection does not have a rectangular shape (because of previous cell merging). You can check possibility of merging using CanMergeSelectedCells.
AllowMergeRC = False forbids to perform merging, if it will cause appearing rows or columns containing only nils. It's not recommended to have such rows/columns, so you can either forbid such operation or delete them with DeleteEmptyRows and DeleteEmptyCols (the latter is recommended).
This method must be called when the document is formatted.
See also methods: