Sub PremierCas()
Dim TabSource() As Variant
Dim TabModif() As Variant
With Sheets("A modifier")
TabModif = .Range("A1").CurrentRegion.Value
End With
With Sheets("Source")
TabSource = .Range("A1").CurrentRegion.Value
End With
For i = LBound(TabModif, 1) To UBound(TabModif, 1)
For j = LBound(TabSource, 1) To UBound(TabSource, 1)
If TabSource(j, 1) = TabModif(i, 1) Then
TabSource(j, 4) = "modifié en O"
End If
Next j
Next i
Sheets("Resultat").Range("A1").Resize(UBound(TabSource, 1), UBound(TabSource, 2)) = TabSource
End Sub
Sub DeuxièmeCas()
Dim TabSource() As Variant
Dim TabModif() As Variant
With Sheets("A modifier")
TabModif = .Range("A1").CurrentRegion.Value
End With
With Sheets("Source")
TabSource = .Range("A1").CurrentRegion.Value
End With
For i = LBound(TabModif, 1) To UBound(TabModif, 1)
For j = LBound(TabSource, 1) To UBound(TabSource, 1)
If TabSource(j, 1) = TabModif(i, 1) Then
TabSource(j, 4) = "modifié en O"
Else
TabSource(j, 4) = "N"
End If
Next j
Next i
Sheets("Resultat").Range("A1").Resize(UBound(TabSource, 1), UBound(TabSource, 2)) = TabSource
End Sub