Compare identifier columns from 2 sheets - remove rows that are dups

L

Livin

I have two sheets with thousands of rows. I need to remove rows from the 2nd
sheet that have the same identifier as rows in the first sheet... so there are
no duplicates.

Example...

'Sheet1'

ddd1234 <several data columns>
ddd1234 <several data columns>
abc1234 <several data columns>
wrd1234 <several data columns>
wrd1234 <several data columns>



'Sheet2'

ddd1234 <several data columns>
abc1234 <several data columns>
wrd1234 <several data columns>
www1234 <several data columns>
ggg1234 <several data columns>


.... yes, Sheet1 may have multiple rows with the same identifier but that does
not matter... I just want to remove rows from Sheet2 anything that matches IDs
from Sheet1 - I don't care about consolidating or removing dups from Sheet1.

thx for the help!
 
I

isabelle

hi Livin,

Sub test()
With Sheets("Sheet2")
For i = .Range("A65536").End(xlUp).Row To 1 Step -1
If Not IsError(Application.Match(.Range("A" & i), Sheets("Sheet1").Range("A:A"), 0)) Then
.Rows(i).Delete Shift:=xlUp
End If
Next
End With
End Sub

--
isabelle



Le 2012-05-04 19:35, Livin a écrit :
 

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