Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Sub Comparaison2Colonnes()
Dim rA As Range, rB As Range, c As Range
Dim Ligne As Long, Debut As Long, Fin As Long
Application.ScreenUpdating = False
Debut = GetTickCount
Columns("C:C" ).Clear
Set rA = Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp))
Set rB = Range(Cells(1, 2), Cells(Rows.Count, 2).End(xlUp))
Ligne = 1
For Each c In rB
If Application.CountIf(rA, c.Value) = 0 Then
If c.Value <> "" Then
Cells(Ligne, 3).Value = c.Value
Ligne = Ligne + 1
End If
End If
Next
Fin = GetTickCount - Debut
Application.StatusBar = "Terminé : " & Format(Fin / 1000, "0.0" )
Application.ScreenUpdating = True
End Sub
|