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

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
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
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,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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