Private Sub CommandButton6_Click()
Dim i&, D As Object, t As Variant, msg$
Dim tableau As Variant
Set D = CreateObject("Scripting.Dictionary")
'T(i) = Valeur en colonne Q
'D(T(i)) = Lettre en colonne R
msg = "Fréquence" & vbTab & vbTab & "A" & vbLf
With Sheets("BDD")
For i = 2 To .Cells(Rows.Count, 17).End(xlUp).Row
If Not IsError(.Cells(i, 17).Value) Then 'si la cellule n'est pas en erreur
If .Cells(i, 2).Interior.ColorIndex = 3 Then 'si la couleur de la cellule est rouge (3)
If .Cells(i, 17).Value > 0 Then 'si la valeur de la cellule est suppérieur à 0
D(.Cells(i, 17).Value) = .Cells(i, 18).Value
End If
End If
End If
Next i
End With
t = D.Keys
Call prctri(t, LBound(t), UBound(t))
ReDim Preserve t(1 To 250)
For i = 1 To 250
ListBox1.List = Format(t(i), "00.00") & vbTab & vbTab & vbTab & D(t(i)) & vbLf
Next i
End Sub