Ecxcel list - compare and select

The attached file contains three columns.
Column A contains a full list of postcodes.
Column B contains a list that includes some of the postcodes that are listed in Column A.
The request is for a script or formula that will create a new column containing all postcodes that listed in Column A but not listed in Column B.
Column D is an example list containing the first few of these missing postcodes.
Who is Participating?
Rgonzo1971Connect With a Mentor Commented:

pls try

Sub macro()

For Each c In Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
    If Not Evaluate("=or(" & c & "=B:B)") Then
        Range("D" & Rows.Count).End(xlUp).Offset(1) = c.Value
    End If
End Sub

Open in new window

Viswanath V PCommented:
would like to share a manual way.
postcodes within A column is unique or no repeats within the column
same goes for B column
Add filter to A and B
then Select whole A and B column together
Use conditional formatting, "Duplicates", change condition to Unique
sort out the highlighted on top
Copy them and paste in a different sheet
Remove the conditions from the second sheet
gregfthompsonAuthor Commented:
Thanks. Nice job.
gregfthompsonAuthor Commented:
Thanks Viswanath VP.

I appreciate your suggestion. Rgonzo1971's script is easier as I have a number of files that have to be processed.

Thanks again,

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.