PDA

View Full Version : Solved: Removing Duplicates In Excel



mattster1010
03-17-2010, 03:58 AM
Good Morning All,

I have the following data example that contains duplicates. The two fields concerned are below: I'd like to remove the whole row if the week ending dates are the same. Does anyone have any idea's of how I may do this?

Employee_NoWeek_Ending_Date71928/02/201071921/02/201071920/02/201071920/02/201071919/02/201071919/02/201071918/02/201071918/02/201071917/02/201071917/02/201071916/02/201071916/02/201071915/02/201071915/02/201071914/02/2010

Regards,

Matt

Bob Phillips
03-17-2010, 04:06 AM
Public Sub ProcessData()
Dim i As Long
Dim LastRow As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 2 Step -1

If Application.CountIf(.Range("B1").Resize(i), .Cells(i, "B").Value2) > 1 Then

.Rows(i).Delete
End If
Next i
End With

End Sub