M
Michelle
I have the following code and need to some how chang it so that it will look
at two rows and remove duplicates based on that...
Say I have
Jim Smith 7-1-07
Jim Smith 7-1-07
Jim Smith 7-1-07
Jim Smith 7-2-07
Jim Smith 7-2-07
Donna Smith 7-2-07
Donna Smith 7-2-07
what I would need is for the code to look at the name and find the dup's
delete them only if the name and the date are dupes for a spread sheet with
about 1700 entries.
here is my current code.
With Cells
Set rng = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
rng.Select
End With
Dim RowNdx As Long
Dim ColNum As Integer
ColNum = Selection(1).Column
For RowNdx = Selection(Selection.Cells.Count).Row To _
Selection(1).Row + 1 Step -1
If Cells(RowNdx, ColNum).Value = Cells(RowNdx - 1, ColNum).Value Then
Cells(RowNdx, ColNum).EntireRow.Delete shift:=xlUp
End If
Next RowNdx
at two rows and remove duplicates based on that...
Say I have
Jim Smith 7-1-07
Jim Smith 7-1-07
Jim Smith 7-1-07
Jim Smith 7-2-07
Jim Smith 7-2-07
Donna Smith 7-2-07
Donna Smith 7-2-07
what I would need is for the code to look at the name and find the dup's
delete them only if the name and the date are dupes for a spread sheet with
about 1700 entries.
here is my current code.
With Cells
Set rng = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
rng.Select
End With
Dim RowNdx As Long
Dim ColNum As Integer
ColNum = Selection(1).Column
For RowNdx = Selection(Selection.Cells.Count).Row To _
Selection(1).Row + 1 Step -1
If Cells(RowNdx, ColNum).Value = Cells(RowNdx - 1, ColNum).Value Then
Cells(RowNdx, ColNum).EntireRow.Delete shift:=xlUp
End If
Next RowNdx