You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MS Excel itself doesn't yet offer the functionality to simply hide the merged cells, or to merge the content of cells into a single cell, but it is available in Open/Libre Office.
1353
+
1354
+
### Merge with MERGE_CELL_CONTENT_EMPTY
1355
+
1356
+
The default behaviour is to empty all cells except for the top-left corner cell in the merge range; and this is also the default behaviour for the `mergeCells()` method in PhpSpreadsheet.
1357
+
When this behaviour is applied, those cell values will be set to null; and if they are subsequently Unmerged, they will be empty cells.
1358
+
1359
+
Passing an extra flag value to the `mergeCells()` method in PhpSpreadsheet can change this behaviour.
The second alternative, available in both OpenOffice and LibreOffice is to merge the content of every cell in the merge range into the top-left cell, while setting those hidden cells to empty.
Particularly when the merged cells contain formulae, the logic for this merge seems strange:
1388
+
walking through the merge range, each cell is calculated in turn, and appended to the "master" cell, then it is emptied, so any subsequent calculations that reference the cell see an empty cell, not the pre-merge value.
The cell value `12` from cell `A2` is fixed; the value from `B2` is the result of the formula `=5-B1` (`4`, which is appended to our merged value), and cell `B2` is then emptied, so when we evaluate cell `C2` with the formula `=A2/B2` it gives us `12 / 0` which results in a `#DIV/0!` error (so the error `#DIV/0!` is appended to our merged value rather than the original calculation result of `3`).
1400
+
1351
1401
## Inserting or Removing rows/columns
1352
1402
1353
1403
You can insert/remove rows/columns at a specific position. The following
0 commit comments