Private Sub TextBox1_AfterUpdate()
If TextBox1 = "" Then Exit Sub
If CDbl(TextBox1.Value) < Feuil2.Range("A2").Value Then
Cancel = True
TextBox1.BackColor = &HFF&
TextBox1.SetFocus
MsgBox "La valeur saisie est inférieure a la tolérance mini,vous pouvez saisir une contre mesure dans la case N°2", vbOKOnly + vbExclamation, "ERREUR"
TextBox2.Visible = True
Label2.Visible = True
Else
TextBox1.BackColor = &H80000005
End If
If TextBox1 = "" Then Exit Sub
If CDbl(TextBox1.Value) > Feuil2.Range("B2").Value Then
Cancel = True
TextBox1.BackColor = &HFF&
TextBox1.SetFocus
MsgBox "La valeur saisie est supérieure a la tolérance maxi,vous pouvez saisir une contre mesure dans la case N°2", vbOKOnly + vbExclamation, "ERREUR"
TextBox2.Visible = True
Label2.Visible = True
Else
End If
End Sub