The absence in LibreOffice Calc of a command similar to the Microsoft Excel merge across command does not mean that Calc is entirely incapable of performing an operation similar to what the merge across command performs. The merge across command might be more descriptively be called merge cells in the rows of a selected area. A nearly identical result can be accomplished in Calc without the need of a macro. The difference being that in Excel the underlying action is a merge and the content in the leftmost cell in the series of cells being merged that has content is preserved in the merged cell. In the Calc operations that simulate this command the content of the leftmost cell in each row of cells being merged is preserved in the merged cell. Meaning that the content in all other cells is lost, (it can be restored by the undo command, but that also undoes the merge). (When the operations described below are performed in Excel (yes, they can be), the results are the same as when they are performed in Calc).
The merging of cells in the rows of a selected area and conversely the merging of cells in columns of a selected area can be accomplished by two different means. (When cells containing content are merged in columns the content is handled in a similar manner to that described above, but it is the content of the topmost cells that is preserved). Both of the methods of accomplishing the merge are multiple step processes, each has some advantages over the other in specific situations. In both of these methods the first step is to merge contiguous cells in a row or column, usually this will be in the area of the spreadsheet where the merge is to occur. It does not matter if the cells that are merged are on the edge of the area to be merged, in the middle of it or not in or near it at all.
Method 1 – Clone formatting
- With the the merged cell selected click the Clone Formatting icon in
the tool bar. (To merge cells in the rows/columns of multiple selections,
double click the icon).
- Click the the leftmost cell in the area at either the top or the bottom row
of the additional row or rows that are to be merged, for column merging
click the topmost cell at either the right or left edge of the area.
- While holding the mouse button, drag the mouse pointer to the other edge
of the area of cells, in the same row or column, that are to be merged
and release the mouse button.
If multiple areas are being merged, repeat steps 2 and 3.
Method 2 – Copy and Paste Special
- With the the merged cell selected copy the merged cell (Ctrl-C or
Edit→Copy or Alt-E Y).
- Click the the leftmost cell in the area at either the top or the bottom
row of the additional row or rows that are to be merged, for column
merging click the topmost cell at either the right or left edge of the area.
- While holding the mouse button, drag the mouse pointer to the other edge
of the area of cells, in the same row or column, that are to be merged
and release the mouse button.
- Type Alt-E S (Edit→Paste Special), clear all check boxes except the
Format box (this setting will remain until changed or the program is
exited). Click OK or press the Enter key.
If multiple areas are being merged, repeat steps 3 and 4.
As mentioned earlier, each method has advantages in specific situations. The Clone Formatting method (method 1) is generally quicker, especially when only one area is being merged. A modification of the Copy and Paste Special method (method 2) can produce the desired results with fewer steps overall when a block of cells in multiple non-contiguous locations, including blocks of cells on different worksheets, need to be merged in a identical manner. After the first area has been merged (either method can be used to accomplish that), select the entire merged area and copy it. Select the topmost leftmost cell of the next location where the merge needs to occur and perform the Paste Special operation. The same number of cells on the same number of rows and columns that were copied will be merged in the new location. Repeat the paste special operation in additional locations, as needed.