Deleting duplicate records

R

RWald

I am combining contact records from 2 different xls worksheets and need to
delete the duplicates. I need to know how to -
1. identify the duplicates [Assuming column A contains last name and column
B first name, I have done this through =IF((A2=A1)*(B2=B1), "duplicate", "")
but dont know if there is a better way :)]
2. tranfer any missing information from duplicate to the reference record
[additional information in columns C-Z]
3. Delete the duplicate record

Thank you!
 
W

ward376

Check out the advanced filter - Data>Filter>Advanced Filter. There is
the option to copy unique records to another range.

Cliff Edwards
 
H

Hardeep_kanwar

you can use COUNTIF Function for example =countif(B:B,B1)

OR you will also use this macros

Sub FindRepeatedValues()
ac = Application.Calculation
Application.Calculation = xlCalculationManual
mb = MsgBox("Finding repeated values - Press Yes to highlight, No
to delete", vbYesNoCancel)
If mb = 2 Then Exit Sub
r = Selection.Row
c = Selection.Column
rr = Selection.Rows.Count - 1
cc = Selection.Columns.Count - 1
i = -1
Do While rr > 0
i = i + 1
If Cells(r + i, c).Value = Cells(r + i + 1, c).Value Then
If mb = 6 Then
With Range(Cells(r + i + 1, c), Cells(r + i + 1, c +
cc)).Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Else
Range(Cells(r + i + 1, c), Cells(r + i + 1, c +
cc)).Delete shift:=xlUp
i = i - 1
End If
End If
rr = rr - 1
Loop
Application.Calculation = ac
End Sub

Hope this will help u

cheers
Hardeep kanwar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top