Bonsoir Jean-Eric, CmMiro, le forum
Une autre façon de procéder :
Option Explicit
Sub test()
Dim a, i As Long, txt As String, dico As Object
Set dico = CreateObject("Scripting.Dictionary")
dico.CompareMode = 1
a = Sheets("Feuil1").Range("b2").CurrentRegion.Value
For i = 2 To UBound(a, 1)
If IsEmpty(a(i, 1)) Then a(i, 1) = a(i - 1, 1)
txt = Join$(Array(a(i, 1), a(i, 2)), Chr(2))
dico(txt) = a(i, 3)
Next
With Sheets("Affaire").Range("a3").CurrentRegion
a = .Value
For i = 2 To UBound(a, 1)
If IsEmpty(a(i, 2)) Then a(i, 2) = a(i - 1, 2)
txt = Join$(Array(a(i, 2), a(i, 3)), Chr(2))
If dico.exists(txt) Then a(i, 4) = dico(txt)
Next
With .Columns(4)
.Offset(1).Resize(.Rows.Count - 1).ClearContents
.Value = Application.Index(a, 0, 4)
End With
End With
Set dico = Nothing
End Sub
klin89