Sub Calcul()
Dim T, Note, Condition, Seuil, i%, j%
T = [EM12].CurrentRegion
For i = 2 To UBound(T)
Note = Cells(i + 11, "AH")
Condition = Cells(i + 11, "AJ")
Seuil1 = Cells(i + 11, "AK"): Seuil2 = Cells(i + 11, "AM")
Select Case Condition
Case "Egal (nombre)"
For j = 1 To UBound(T, 2)
If T(i, j) = Seuil1 Then T(i, j) = Note Else T(i, j) = 0
Next j
Case "Egal (texte)"
For j = 1 To UBound(T, 2)
If T(i, j) = "Programmable" Then T(i, j) = Note Else T(i, j) = 0 ' ICI je veux le changement
Next j
Case "Une plage"
For j = 1 To UBound(T, 2)
If T(i, j) >= Seuil1 And T(i, j) <= Seuil2 Then T(i, j) = Note Else T(i, j) = 0
Next j
Case "Supérieur ou égal"
Maxi = 0
For j = 1 To UBound(T, 2)
If T(i, j) >= Maxi Then Maxi = T(i, j)
Next j
For j = 1 To UBound(T, 2)
If T(i, j) >= Seuil1 Then T(i, j) = Note * T(i, j) / Maxi Else T(i, j) = 0
Next j
Case "Inférieur ou égal"
Mini = 9 ^ 9
For j = 1 To UBound(T, 2)
If T(i, j) <= Mini Then Mini = T(i, j)
Next j
For j = 1 To UBound(T, 2)
If T(i, j) <= Seuil1 Then T(i, j) = Note * Mini / T(i, j) Else T(i, j) = 0
Next j
End Select
Next
[GL12].Resize(UBound(T, 1), UBound(T, 2)) = T
MsgBox "La notation a été finalisée et est prête à être consultée."
End Sub