compare each cell of column to same cell of another column excel code example
Example 1: excel vba How to compare two entire rows in a sheet
MsgBox [and(1:1=2:2)]
Example 2: how to know duplicate in excel in two columns
=INDEX($A$2:$B$14,MATCH("*"&D2&"*",$A$2:$A$14,0),2)