Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to merge every other row/cell in Excel?

If you have a list of data, and you want to combine every other row or cell of them as shown as below, do you know how to get it done? In Excel, you can use formula or VBA to merge every other row or cells.


Merge every other row/cell with formula in Excel

Merge every other row/cell with VBA

Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.

arrow blue right bubble Merge every other row/cell with formula in Excel


Select a blank cell and type =OFFSET(A$1,(ROW()-1)*2,0)&" "&OFFSET(A$1,((ROW()-1)*2)+1,0) ( A$1 indicates the first data in your list, you can change it as you need), and press Enter key. Then drag the fill handle to fill the range you need to apply this formula. See screenshot:



arrow blue right bubble Merge every other row/cell with VBA

If you are used to use VBA, you also can run the below VBA to merge every other row.

1. Hold ALT button and press F11 on the keyboard to open a Microsoft Visual Basic for Application window.

2. Click Insert > Module, and copy the VBA into the module.

VBA: Merge every other row/cell

Sub CombineCells()
'Updateby20140314
Dim rng As Range
Dim InputRng As Range, OutRng As Range
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
For i = 1 To InputRng.Rows.Count Step 2
    For j = 1 To InputRng.Columns.Count
        OutRng.Value = InputRng.Cells(i, j).Value & InputRng.Cells(i + 1, j).Value
        Set OutRng = OutRng.Offset(0, 1)
    Next
    Set OutRng = OutRng.Offset(1, (InputRng.Columns.Count * -1))
Next
End Sub         

 

3. Click Run to run the VBA code, and a KutoolsforExcel dialog pops up for you to select a range of cells that you want to merge the every other row. See screenshot:


4. Click OK, another dialog displays for you to select a single cell to put out the merged result. See screenshot:


5. Click OK, and you can see the result:



Relative Articles:

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.