Option Explicit
Sub test()
Dim a, i As Long, w(), x, y
a = Sheets("Feuil1").Cells(1).CurrentRegion.Value
With CreateObject("Scripting.Dictionary")
For i = 2 To UBound(a, 1)
If Not .exists(a(i, 1)) Then
.Item(a(i, 1)) = VBA.Array(a(i, 1), a(i, 2), a(i, 3), a(i, 4))
Else
w = .Item(a(i, 1))
If a(i, 2) = "confirmé" Then
w(1) = a(i, 2): w(2) = a(i, 3): w(3) = a(i, 4)
End If
.Item(a(i, 1)) = w
End If
Next
x = .Count: y = .items
'restitution
With Sheets("Feuil2").Cells(1)
.Resize(1, 4).Value = a
With .Offset(1).Resize(x, 4)
.Value = Application.Index(y, 0, 0)
End With
.Parent.Activate
End With
End With
End Sub