Merging Cells
Overview
If you prefer, the control can automatically combine cells that have the same contents. You might want to do this, for example, when bound to a database, as shown in the following figure.
Unlike spanning cells, merging is an automatic feature. You tell the control which columns and rows allow cells to be combined automatically, and any cells within that set that have the same contents are combined for you.
Merged cells do not lose their data; it is simply hidden by the merge. If you remove the merge, the data appears in each cell that was in the merge. You can edit a cell that is merged with another cell. When you double-click the cell to turn edit mode on, the contents of the cell appear in the cell for you to edit them. When you leave edit mode, if the contents of the cell are no longer identical to the cell or cells with which it was previously merged, the cells are no longer displayed as merged.
Cells that are different cell types but have the same contents can merge. If the contents change or the merge is removed, the cells maintain their cell types as well as their data.
If a merged column overlaps a span then the merged column replaces the span. It is recommended that merging and spanning not be used on the same sheet.
You can have the cells in the specified column or row combine the cells automatically, or only combine them if the cells to their left (in columns) or above them (in rows) are merged.
Merged cells take on the properties of the top-left merged cell. For example, if the top-left merged cell has a blue background color, the cells that merge with it display the same background color.