Bonjour,
Procédure à substituer :
Private Sub R1_Change()
Dim obj(), i%, j%, k%, mach$
Réinit True
If R1.ListIndex > -1 Then
mach = R1.Value
With [BMach]
For i = 1 To .Rows.Count
If .Cells(i, 1) = mach Then
ReDim Preserve obj(j)
obj(j) = .Cells(i, 2): j = j + 1
End If
Next i
End With
If j > 1 Then
ReDim Preserve obj(j)
For i = 0 To j - 2
For k = i + 1 To j - 1
If obj(k) < obj(i) Then
obj(j) = obj(k): obj(k) = obj(i): obj(i) = obj(j)
End If
Next k
Next i
ReDim Preserve obj(j - 1)
lbxR2.List = obj
Else
lbxR2.AddItem obj(0)
End If
End If
End Sub
Cordialement.