subtracting (extracting non-duplicate items)HELP!!

R

rtek

Please help, is there any way to do this? i will try to explain..

I have 2 huge lists. One is " the Master list" which I have to extract
items that are not already listed on the second list . I don't want to
remove duplicate entries,I want to remove the duplicates completely. in
both lists, so that I only have items that are not in the second
list...I did some searchin but i would really appreciate if someone
helped me..

like this..

List 1:
# $ % & * ! @
List 2:
# & @

so I want to end up with:
$ % * !
 
B

Bob Phillips

Assuming that you have named the two ranges list1 and list2

Sub DeleteDuplicates()
Dim iRows As Long
Dim iStartRow As Long
Dim i As Long

iRows = Range("list1").Rows.Count
iStartRow = Range("list1").row
For i = iRows + iStartRow - 1 To iStartRow Step -1
If Not IsError(Application.Match(Cells(i, "A").Value,
Range("list2"), 0)) Then
Rows(i).Delete
End If
Next i
End Sub


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
B

broro183

Hi,

Have a look at Chip's page:
http://www.cpearson.com/excel/duplicat.htm


A "count if" from Chip's page could be applied to a column next to the
lists (in both spreadsheets), copied & pasted as values (to prevent
values changing after rows are deleted), the lists filtered for all
values in the countif column which are greater than zero, & then the
visible rows deleted.


hth
Rob Brockett
NZ
Always learning & the best way to learn is to experience...
 

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