Sub moymen()
  Dim som As Double, moy As Double, i As Integer, r As Object, men As String
  Set r = Range("b1:b5")
  som = 0
  For i = 1 To r.Count
    x = r.Cells(i)
    som = som + x
  Next
  moy = som / r.Count
  r.Cells(6, 1).Value = moy
  If moy < 10 Then
     men = "ajourné"
  ElseIf moy < 12 Then
     men = "passable"
  ElseIf moy < 14 Then
     men = "assez bien"
  Else
     men = "bien"
  End If
  r.Cells(7, 1) = men
  For i = 1 To 6
    If r.Cells(i, 1) < 10 Then
      With r.Cells(i, 1)
        .Interior.Color = vbCyan
        .Font.Color = vbRed
      End With
    End If
  Next
End Sub
Sub maxmin()
  Dim r As Object
  Set r = Selection
  Dim min As Double, max As Double, i As Integer
  min = r.Cells(1)
  max = min
  For i = 2 To r.Count
    With r.Cells(i)
      If IsNumeric(.Value) Then
        If .Value < min Then min = .Value
        If .Value > max Then max = .Value
      End If
    End With
  Next
  r.Cells(r.Count + 1, 1).Value = min
  r.Cells(r.Count + 2, 1).Value = max
End Sub