Voilà les 2 codes, que tu affectes à un objet sur la feuile, tu saves en xlsm et ça ira :
' comparer colonne A et B et remettre en E les données Uniques donc sans doublon !!
' pmk 2015
Sub UniqColonneE() ' 1er code
Dim r As Range, dico As Object, x, A, b, i&, S ' déclaration des variables OK
Set dico = CreateObject("Scripting.Dictionary")
Set Ws1 = Sheets("Feuil1")
LastrowA = Range("A65000").End(xlUp).Row
lastrowb = Range("B65000").End(xlUp).Row
plus = IIf(LastrowA < lastrowb, lastrowb, LastrowA)
Set r = Range("A1:B" & plus) ' ws1.[A65000].End(xlUp).Row)
For Each r In r ' pour chaque cellule dans le range "r"
If r <> "" Then
x = r ' ? scalaire plus rapide, évite de répéter r.Value
If Not dico.Exists(x) Then '
dico(x) = dico(x) & r.Offset(, 1)
End If
End If
Next
'---restitution en colonne E---
Application.ScreenUpdating = False ' OK
Range("E2:E" & Rows.Count).Clear ' OK
If dico.Count = 0 Then Exit Sub ' si vide on sort OK
A = dico.Keys
b = dico.Items
For i = 0 To UBound(A) ' boucle de 0 à nombre d'occurences les "array" commencent toujours à 0
Cells(i + 1, 5) = A(i)
Next
Columns(5).AutoFit
End Sub
Sub RepérerDoublons() 'JB 2e code
'Repérage des doublons entre 2 colonnes
Set D1 = CreateObject("Scripting.Dictionary")
Set d2 = CreateObject("Scripting.Dictionary")
Set Plage1 = Range("A1", [A65000].End(xlUp))
Set plage2 = Range("B1", [B65000].End(xlUp))
[A:B].Interior.ColorIndex = xlNone
For Each C In Plage1
If C <> "" Then D1(C.Value) = ""
Next C
For Each C In plage2
If D1.Exists(C.Value) Then C.Interior.ColorIndex = 3
If C <> "" Then d2(C.Value) = ""
Next C
For Each C In Plage1
If d2.Exists(C.Value) Then C.Interior.ColorIndex = 4
Next C
End Sub