# Excel duplicates removal but with a twist !

#### charleskavazy

##### New Member
I would really appreciate some Excel help to remove "partial duplicates but with a twist".

Here is an example of what I mean:

Eg. I have two rows , row one is Fred Blogs Cat (in columns A, B and C on row 1) and the second row, Fred Blogs Dog (in columns A, B and C on row 2) and I want to end up with one row Fred Blogs Cat Dog (in columns A, B, C and D on row 1) and the second row is deleted.

I have over 80,000 rows to deal with so some help would be really, really appreciated!

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi,

Can there be more than 2 entries per name combination?

Dom

Hi Domski

Thanks for responding

Unfortunately yes there can be more than 2. I think 4 rows is the maximum.

Try this but make sure you've got you're data saved as have not thoroughly tested it:

Code:
``````Sub De-Dup_Sort_Of()
Dim lastRow As Long, myRow As Long, writeRow As Long, writeCol As Long
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
writeCol = 3
writeRow = 2
For myRow = 2 To lastRow
If Cells(myRow, 1) & "_" & Cells(myRow, 2) = Cells(myRow + 1, 1) & "_" & Cells(myRow + 1, 2) Then
writeCol = writeCol + 1
Cells(writeRow, writeCol) = Cells(myRow + 1, 3)
Else
writeCol = 3
writeRow = myRow + 1
End If
Next myRow
For myRow = lastRow To 2 Step -1
If Cells(myRow, 1) & "_" & Cells(myRow, 2) = Cells(myRow - 1, 1) & "_" & Cells(myRow - 1, 2) Then
Cells(myRow, 1).EntireRow.Delete
End If
Next myRow
End Sub``````

Sort your data by column A and B before you run it.

Hope it helps,

Dom

Thanks for that. I will give it a go. Really appreciate your help.

Replies
7
Views
197
Replies
2
Views
119
Replies
3
Views
102
Replies
15
Views
472
Replies
7
Views
163

1,214,264
Messages
6,118,560
Members
448,837
Latest member
Josephjet

### 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.

### Which adblocker are you using?

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

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