I want to merge two rows, where a particular cell matches

sewercider

New Member
Joined
Oct 22, 2018
Messages
7
Hey All,


I am stumped on the following and would greatly appreciate any help on offer!


I have two rows of data which share a common cell (URL), that I would like to effectively merge like so:


Before:
Y7KzRVo.jpg



After:
7RVWukO.jpg



Can this be done?


Kind regards,
Cas
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Is it always col "B" and "D" that will be affected ??
Is a VBA solution OK for you ??
 
Upvote 0
Hey Michael, yes - basically when there is a match with column B, I just want the column D data to appear alongside column C data. VBA should be fine... I haven't employed such a solution before but hopefully can work out!!
 
Upvote 0
Try this....Untested, so test it on a copy

Code:
Sub MM2()
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
For r = lr To 2 Step -1
    If Range("B" & r).Value = Range("B" & r - 1).Value Then
        Range("D" & r - 1).Value = Range("D" & r).Value
        Rows(r).Delete
    End If
Next r
End Sub
 
Upvote 0
That worked a treat! Thank you so much. That is incredibly useful, I will be using this quite a bit I reckon!
 
Upvote 0
Cross posting means ther may be other people trying to solve your problem, when others have already done so.....thereby wasting posters time.....and getting them offside !
Please read rule #13 of our posting rules
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top