View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default removing duplicate entries

Sub ClearData()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Application.CountIf(Columns(1), Cells(i, "A").Value) 1 Then
Rows(i).Delete
End If
Next i
End Sub


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"armagan" wrote in
message ...

hi,

I'm trying to remove duplicate entries from a list of names &
addresses.

what I'm after is some VBA code which will examine row by row the 'post
code' field and the 'Full name' field and highlight/delete duplicate
entries.

its best illustrated by an example

FULL NAME ADDRESS
POSTCODE
Mr C. Verougstraete 6 somone st, Leicester HY8 9YK
Mrs R. Brazier 8 high st
HY9 9LK
Mr C. Verougstraete 6 somone st, HY8
9YK

the last record is obviously a duplicate of row 2 therefore will be
removed

any help greatly appreciated

thanks


--
armagan
------------------------------------------------------------------------
armagan's Profile:

http://www.excelforum.com/member.php...o&userid=34237
View this thread: http://www.excelforum.com/showthread...hreadid=551068