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 29 30 31 32 33 34 35 36 37 38 39 40
|
Private Sub indicateur(Rge As Range, of As Variant)
Dim pente As Double
Dim dispo As Double
Dim vert, orange, rouge As Double
Dim seuil1, seuil2 As Double
pente = Round(Rge.Offset(of, -1).Value * 1000, 0)
dispo = Rge.Offset(of, -2).Value * 100
vert = Range("VERT").Font.Color
orange = Range("ORANGE").Font.Color
rouge = Range("ROUGE").Font.Color
seuil1 = Range("SEUIL1").Value
seuil2 = Range("SEUIL2").Value
If pente > 0 Then
ret = "ì"
ElseIf pente = 0 Then
ret = "è"
Else
ret = "î"
End If
If dispo >= seuil1 Then
Rge.Offset(of).Font.Color = vert
ElseIf dispo < seuil1 And dispo > seuil2 Then
Rge.Offset(of).Font.Color = orange
Else
Rge.Offset(of).Font.Color = rouge
End If
Rge.Offset(of).Value = ret
Rge.Offset(of).Font.Name = "Wingdings"
End Sub |
Partager