Option Explicit
Private Sub ComboBox1_Change()
Dim c As Range, x As Byte, b As Byte, d As Date
Dim t() As Variant, Total As Double, Total2 As Double
ListBox1.Clear
ListBox1.ColumnCount = 6
ListBox1.ColumnWidths = "50;50;50;50;20;0"
ListBox1.ColumnHeads = True
For Each c In Range("c1:c" & Range("A65536").End(xlUp).Row)
If c = ComboBox1 Then
ListBox1.AddItem c.Offset(0, -2).Value
ListBox1.List(x, 1) = c.Offset(0, -1).Text
ListBox1.List(x, 2) = c.Value
ListBox1.List(x, 3) = c.Offset(0, 1).Value
If c.Offset(0, 1).Value = "rouge" Then
ListBox1.List(x, 4) = (10)
ElseIf c.Offset(0, 1).Value = "vert" Then ListBox1.List(x, 4) = (6)
ElseIf c.Offset(0, 1).Value = "jaune" Then ListBox1.List(x, 4) = (4)
End If
ListBox1.List(x, 5) = c.Offset(0, -2).Value + c.Offset(0, -1).Value
x = x + 1
End If
Next c
With ListBox1
For b = 0 To .ListCount - 1
Total = Total + .List(b, 4)
If d < .List(b, 5) Then d = .List(b, 5)
Next
For b = 0 To .ListCount - 1
If d = .List(b, 5) Then Total2 = Total2 + .List(b, 4)
Next
End With
TextBox1.Value = Total
TextBox2.Value = Total2
End Sub