How to remove duplicate records

  • Thread starter Thread starter hmb
  • Start date Start date
H

hmb

I have downloaded 4000 address is their a simple way
besides going through all records to remove the duplicates
 
assuming the records are in column A, A1 is a heading
like "list" and a2-a... contains the addresses.

Highlight the list goto data|filters|advance filter
check the unique records block and if you want select
copy to another location.. as in b1.

Lance
 
-----Original Message-----
I have downloaded 4000 address is their a simple way
besides going through all records to remove the duplicates


I had the same problem recently. Are you familiar with
macros? If so, try this:

Sub FindDups()
'
' NOTE: You must select the first cell in the column and
' make sure that the column is sorted before running
this macro
'
ScreenUpdating = False
FirstItem = ActiveCell.Value
SecondItem = ActiveCell.Offset(1, 0).Value
Offsetcount = 1
Do While ActiveCell <> ""
If FirstItem = SecondItem Then
ActiveCell.Offset(Offsetcount, 0).Interior.Color =
RGB(255, 0, 0)
Offsetcount = Offsetcount + 1
SecondItem = ActiveCell.Offset(Offsetcount,
0).Value
Else
ActiveCell.Offset(Offsetcount, 0).Select
FirstItem = ActiveCell.Value
SecondItem = ActiveCell.Offset(1, 0).Value
Offsetcount = 1
End If
Loop
ScreenUpdating = True
End Sub
 
Back
Top