Bonsoir à tous,
Une autre façon de procéder :
Option Explicit
Sub test()
Dim a, i As Long, w, txt As String
a = Sheets("Feuil2").Range("a1").CurrentRegion.Value
With CreateObject("Scripting.Dictionary")
.CompareMode = 1
For i = 2 To UBound(a, 1)
If a(i, 3) = "PU" Or a(i, 3) = "PAD" Or a(i, 3) = "" Then
txt = Join$(Array(a(i, 1), a(i, 2)), Chr(2))
Select Case a(i, 3)
Case "PU"
If a(i, 4) = 0 Then
.Item(txt) = "Erreur"
Else
.Item(txt) = a(i, 4)
End If
Case "PAD"
.Item(txt) = "Pas encore fini"
Case ""
.Item(txt) = "Pas de correspondance"
End Select
End If
Next
a = Sheets("Feuil1").Range("a1").CurrentRegion.Value
For i = 2 To UBound(a, 1)
txt = Join$(Array(a(i, 1), a(i, 2)), Chr(2))
If .exists(txt) Then
w = .Item(txt)
a(i, 3) = w
End If
Next
Sheets("Feuil1").Range("a1").Resize(UBound(a, 1), UBound(a, 2)).Value = a
End With
End Sub
klin89