View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
BadgerMK BadgerMK is offline
external usenet poster
 
Posts: 1
Default Compare 2 columns for unique values


Hi Jim

Not sure if there is a unique function that would help, but here are a
couple of ways (as usual there is normally more then one way of doing
things);

1. Import each list into Access as seperate tables and run an unmatched
query

2. the follwoing code will loop down one list checking for a match, you
could then do the same for the second list.

intCompare = 0

For Each r In Range("CheckList1")
a = UCase(r.Value)
b = UCase(r.Offset(0, 2).Value)

For Each s In Range("CheckList2")
c = UCase(s.Offset(0, 9).Value)
d = UCase(s.Offset(0, 10).Value)
If b = c And a = d Then
intCompare = 2
strCaseID = s.Value
r.Offset(0, 3).Value = intCompare
r.Offset(0, 4).Value = strCaseID
intCompare = 0
strCaseID = ""
Exit For
End If
Next s
Next r

Hope this helps


--
BadgerMK
------------------------------------------------------------------------
BadgerMK's Profile: http://www.excelforum.com/member.php...o&userid=31406
View this thread: http://www.excelforum.com/showthread...hreadid=511043