Re à tous,
Avec le pattern de JFL :
Option Explicit
Sub test()
Dim a, e, s, i As Long, dico As Object, m As Object
Set dico = CreateObject("Scripting.Dictionary")
dico.CompareMode = 1
With Sheets("Feuil1").Cells(1).CurrentRegion
a = .Value
With CreateObject("VBScript.RegExp")
.Global = True
.Pattern = "[^0-9]+"
For i = 2 To UBound(a, 1)
If a(i, 8) <> "" Then
If .test(a(i, 8)) Then
Set m = .Execute(a(i, 8))
s = Trim$(m(0))
If Not dico.exists(s) Then
dico(s) = a(i, 6)
Else
dico(s) = Application.Max(dico(s), a(i, 6))
End If
End If
End If
Next
End With
For Each e In dico.keys
If dico(e) > 2000 Then
dico.Remove e
End If
Next
End With
If Not Evaluate("isref('Resultat'!a1)") Then
Sheets.Add(, Sheets(Sheets.Count)).Name = "Resultat"
End If
If dico.Count > 0 Then
With Sheets("Resultat")
.Columns(1).Clear
.Range("A1").Resize(dico.Count).Value = Application.Transpose(dico.keys)
End With
End If
Set dico = Nothing
End Sub
klin89