To merge cells horizontally in every row of a selected range in Excel for Microsoft 365 on Windows, select the range, then choose Home > Merge & Center ▼ > Merge Across. Excel creates a separate merged cell for each row; it keeps the leftmost cell’s content in each row and removes content from the other cells, so check your data before confirming.
What “merge cells in each row” means
A merge combines multiple adjacent cells into one larger cell. When you choose Merge Across on a rectangular selection, Excel merges cells across the columns separately for each row. For example, selecting A2:C4 produces three merged areas: A2:C2, A3:C3, and A4:C4. It does not combine all nine cells into one large block, and it does not merge the rows vertically.
This command is useful when each row needs a single wide heading or label—for example, a title spanning columns A through D on each section row. The merged area still behaves as one cell, however. Its stored value belongs to the top-left cell of that particular row’s merged area, and the extra width is for display rather than additional data storage.
Merge each row using the ribbon
- Select the rectangular range covering the rows and columns you want to combine. For example, select B2:E8 to merge B:E separately in rows 2 through 8.
- Open the Home tab. In the Alignment group, open the drop-down beside Merge & Center.
- Choose Merge Across. If Excel warns that only the upper-left value will be kept, review the selected cells and proceed only if that is acceptable.
The result is seven merged areas, one on each row from 2 through 8. Excel does not center the text automatically with Merge Across. If you want centered labels, apply the desired horizontal alignment after merging using the Alignment controls on the Home tab. You can also adjust borders, font, fill, and wrapping as needed.
On Excel for Mac, select the range and use the Home tab’s merge drop-down to choose Merge Across; the ribbon layout may look slightly different from Windows. In Excel for the web, look for the merge options on the Home tab. If the command is unavailable in your current interface or selection, use the desktop app for the full set of controls.
What happens to existing cell contents
Merging is a layout operation, not a way to join text. When a row contains entries in multiple selected cells, Excel retains the value in the leftmost cell and discards the contents in the other cells in that row. For example, if A2 says “North,” B2 says “Region,” and you merge A2:B2, “North” remains and “Region” is removed. The same rule applies independently to every row in the selection.
Excel normally displays a warning when a merge would discard content. Do not treat the warning as a backup: after confirming, the removed values are not stored in the merged cell. Undo may reverse the most recent merge if you have not performed later actions, but it is safer to preserve the source values first. Copy the original range to another worksheet or workbook, or combine the text into the leftmost cell before merging if the combined wording is what you need.
Also distinguish displayed content from cell content. A merged area may look like several columns remain available, but only its top-left cell can hold a value. You cannot put one independent value in each of the cells that visually lie beneath the merged area.
Choose the right range before merging
Excel applies Merge Across to every row within the selection, using all of the selected columns. Check the selection outline before running the command: selecting B2:E8 merges four columns on seven rows, while selecting B2:E2 affects only one row. If you need different spans on different rows—for instance, B:C on one row and B:E on another—select and merge those ranges separately.
- For repeated row labels: Select only the columns that should become one cell, not the entire worksheet row.
- For a title above a table: Merge only the title row, and keep the actual table’s data cells unmerged.
- For blank rows or section breaks: Include them only if they also need merged cells; otherwise, select the relevant row ranges individually.
- Before applying borders or fills: Check whether the range includes neighboring content that should remain separate.
Merge Across works on a contiguous rectangular selection. It is not a command for joining unrelated cells scattered around a worksheet. If you have multiple separate blocks, process each block on its own and confirm that every block has the intended row and column boundaries.
Repeating the task across many rows
For a one-time operation, selecting the range and using Merge Across is usually the clearest option. If you must repeat the same merge over many worksheets or on a recurring report, a VBA macro can merge each row in the currently selected rectangular range. The following example checks that at least two columns are selected, asks for confirmation, and then merges each row. Save a copy of the workbook before running a macro: VBA changes cannot be undone with Ctrl+Z.
To use it, press Alt+F11 on Windows to open the Visual Basic Editor, choose Insert > Module, paste the code into the module, return to the worksheet, select one contiguous rectangular range, and run the macro. Save a macro-enabled copy as an .xlsm file if you want to retain the code.
Sub MergeEachSelectedRow()
Dim target As Range
Dim rowRange As Range
Dim priorAlerts As Boolean
' Require a selection spanning at least two columns.
If TypeName(Selection) <> "Range" Then Exit Sub
Set target = Selection
If target.Columns.Count < 2 Then Exit Sub
' Confirm because values outside each row's first cell are removed.
If MsgBox("Merge each row? Only the leftmost value in each row is kept.", _
vbYesNo + vbExclamation, "Confirm row merges") <> vbYes Then Exit Sub
priorAlerts = Application.DisplayAlerts
On Error GoTo CleanUp
Application.DisplayAlerts = False
For Each rowRange In target.Rows
rowRange.Merge
Next rowRange
CleanUp:
Application.DisplayAlerts = priorAlerts
End Sub
The macro is intentionally limited to a single rectangular selection. It follows the same data-retention rule as the ribbon command, so the confirmation is important. If you do not need automation, the ribbon command avoids enabling macros and is easier to review before applying.
When merging causes problems
Merged cells can make a worksheet harder to edit and analyze. A common issue is sorting: Excel may refuse to sort a range containing merged cells of inconsistent sizes, and even where a sort is possible, merged layouts can make row relationships confusing. Merged cells can also complicate selecting, pasting, filling, and resizing rows. Excel tables do not support merged cells within the table body, so do not merge cells in a range you intend to format as a structured table.
Filtering is another reason to keep data areas unmerged. A merged label that spans several records may not behave like a normal value repeated on each record, making filtered results less clear. For worksheets used for data entry, formulas, or reporting, keep one record per row and store each field in its own cell. Apply visual formatting to headers or section labels outside the data block instead.
If a merge creates an unexpected result, use Home > Merge & Center ▼ > Unmerge Cells to separate the cells again. Unmerging restores the individual cells, but it does not recover values that were discarded when they were merged. The retained value remains in the top-left cell, and the other cells are empty. Undo immediately after a merge may restore the earlier contents, but unmerge by itself is not a recovery tool.
Safer alternatives to merged cells
If your goal is appearance rather than creating one large cell, consider Center Across Selection. It centers text across a selected span without actually merging the cells, which helps preserve a worksheet’s normal grid for sorting, copying, and data entry. Select the cells, open Format Cells (Ctrl+1 on Windows), choose the Alignment tab, set the Horizontal option to Center Across Selection, and select OK. On Mac, use Command+1 to open Format Cells; the dialog may be arranged differently.
Other options depend on the purpose of the layout:
- For a heading over columns: Use Center Across Selection, or place the heading in one cell and adjust column widths or text wrapping.
- For a label repeated beside records: Fill the label down into each row instead of merging vertically or horizontally.
- For combining text from multiple cells: Join the values into a separate cell before considering a merge, and keep the original values if they may be needed later.
- For a printed report: Use page layout, alignment, borders, and row heights to create a clear visual grouping without altering the data structure.
Center Across Selection is often the better choice for a heading that needs to look centered across columns while remaining compatible with ordinary cell operations. A true merge is more appropriate when the cells genuinely need to act as one display area and the range is not part of a sortable or filterable dataset.
Frequently Asked Questions
How do I merge cells across each row in Excel?
Select the rectangular range, then choose Home > Merge & Center ▼ > Merge Across. Excel creates a separate horizontal merge for each selected row.
Does Merge Across keep all the data?
No. It keeps the leftmost cell’s value in each row and removes values in the other cells being merged. Copy or combine important contents before merging.
Can I merge cells in every row without doing them one at a time?
Yes. Select all the desired rows and columns as one rectangle, then choose Merge Across. For recurring work, a VBA macro can process the selected rows, but save a workbook copy first.
How do I undo or reverse a merge?
Use Ctrl+Z immediately if the merge is the latest action. Otherwise, choose Home > Merge & Center ▼ > Unmerge Cells. Unmerging separates the cells but does not bring back discarded values.
Why is Merge Across unavailable or causing trouble with my table?
Check that you selected multiple adjacent columns in a normal worksheet range. Merged cells are not supported inside an Excel table’s data body; keep table cells separate and use alignment or formatting for the appearance you want.
Related
- Excel Shortcut to Hide a Column on Windows and Mac
- Excel: Hide Row and Column Numbers from the Worksheet View
- Excel Hide Specific Columns: Steps and Tips
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Find and Replace: Change Multiple Words at OnceExcel can replace multiple different words in a worksheet, but the Find and Replace dialog handles only one…
- Excel Not Responding? Causes, Fixes, and Recovery StepsIf Excel is not responding, wait briefly to see whether it is finishing a calculation or loading a…
- Percentage Sheet in Google Sheets: Formulas and SetupYes—Google Sheets can create a percentage sheet, and it can open or export an Excel .xlsx workbook. Enter…
- Excel Days, Hours, and Minutes: Format DurationsTo show an elapsed time in Excel as days, hours, and minutes, keep the duration as a number…
- Excel File Merge Online Free: Safe Ways to Combine WorkbooksYes, you can merge Excel files online for free, but the best method depends on what you mean…
- Excel Merge Cells but Keep All Data?No—Excel cannot merge cells while retaining each cell’s value as separate data. When you merge a range, it…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.