Option Explicit
Sub commentaire()
Dim TI As Single: TI = Timer
Dim d As Object
Set d = CreateObject("Scripting.Dictionary")
Dim Flag As Boolean
Dim Clef As String
Dim Tb() As Variant
Dim i, cpt As Double
' ****************************************************************************************************
Dim ws As Worksheet
Set ws = Worksheets("Export EVERWIN")
Tb = ws.Range(ws.Cells(2, 2), ws.Cells(ws.Cells(65536, 5).End(xlUp).Row, 6))
' ****************************************************************************************************
For i = LBound(Tb) To UBound(Tb)
Clef = Tb(i, 4) & "|" & Tb(i, 5)
If d.Exists(Clef) Then
Tb(i, 1) = Tb(cpt, 1)
Else
cpt = d.Count + 1
d.Add Clef, cpt
If Flag = False Then
Tb(i, 1) = "Caramel": Flag = True
Else
Tb(i, 1) = "Caramel ": Flag = False
End If
End If
Next i
'colonne à extraire en colonne : Application.Index(Tb, , 1) (colonne 1 du tableau "Tb")
ws.Cells(2, 2).Resize(UBound(Tb, 1), 1).Value = Application.Index(Tb, , 1)
MsgBox Format(Timer - TI, "0.000\ sec.")
End Sub