Private Sub CommandButton1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim A: A = [F2]
If Button = 1 Then
A = A + 3
[F2] = Application.Min(A, 100)
End If
End Sub
Private Sub CommandButton2_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim A: A = [F2]
If Button = 1 Then
A = A - 3
[F2] = Application.Max(A, 0.1)
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$2" Then thermo
End Sub
Sub thermo()
Dim X#, grd1#, grd2#, grd3#, grd4#, C1&
X = (100 - [F2]) / 100
C1 = RGB(255, 255, 150) 'couleur de fond
With ActiveSheet.Shapes(1).Fill
.ForeColor.RGB = C1
.OneColorGradient msoGradientHorizontal, 1, 1
If X > 0.02 Then gd1 = X Else gd1 = 0.02
If X > 0.1 Then gd2 = X Else gd2 = 0.1
If X > 0.3 Then gd3 = X Else gd3 = 0.3
If X > 0.8 Then gd4 = X Else gd4 = 0.8
.GradientStops.Insert (C1), gd1
.GradientStops.Insert RGB(255, 0, 0), gd2
.GradientStops.Insert RGB(0, 255, 0), gd3
.GradientStops.Insert RGB(0, 0, 255), gd4
.GradientStops.Insert RGB(0, 0, 255), 0.999
End With
End Sub