1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Sub meilleur_classe()
'
' permet de classer la meilleur classe d'un niveau
'
Dim Cel As Range, Plage As Range
Dim num_class As String
Dim note_ref As Integer, Ligne As Integer
Application.ScreenUpdating = False
For Ligne = 3 To 21 Step 6
Set Plage = Cells(Ligne, 10).Resize(6, 1)
note_ref = Range("J3").Value
note_ref = Cells(Ligne, 10).Value
For Each Cel In Plage
If Cel.Value < note_ref And Cel.Value <> "" Then
note_ref = Cel.Value
num_class = Cel.Offset(0, -5).Value
End If
Next
Cells(17 + Ligne / 3, 14) = num_class
Next Ligne
Set Plage = Nothing
Range("A1").Select
End Sub |