Another way that does not copy elsewhere IF? sorting is allowed. Assumes all
text in ONE cell??
'==
Option Explicit
Sub SortAndDeleteDuplicatesSAS()
Dim mc As Long
Dim i As Long
mc = 1 'column A
Columns(mc).Sort Key1:=Cells(1, mc), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,Orientation:=xlTopToBottom
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i - 1, mc) = Cells(i, mc) Then Rows(i).Delete
Next i
End Sub
'====
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Jbm" <(E-Mail Removed)> wrote in message
news:1FA919E8-69ED-4C39-BCB1-(E-Mail Removed)...
> Hi,
> I checked out the archives for close to an hour, but I couldn't figure out
> how to change the codes given there to suit my needs.
> I have a large set of data, from about A1 to X441. In column X, there are
> a
> lot of exact duplicates, and I need to delete the rows where those
> duplicates
> are (but still leaving the first instance of the duplicate). For example:
>
> John Smith Oxford St.
> John Johnson Oxford St.
> John Johnson Rubble St.
> John Smith Oxford St.
>
> All of those have things in common, but I only want to delete the final
> row
> (and the whole row, not just the cell), because it is an exact duplicate.
> How do I code for this? Excel 2007.
> Thanks,
> Jbm