Bonjour pihuce,
Si tu veux comparer des valeurs, il faut que ce soit des nombres et non du texte
Sinon tu auras droit à ce genre de chose
Voici le code pour ton USF1
Dim Min As Double, Max As Double, MaVal As Double
Private Sub mel_termine_Click()
ActiveCell.Offset(0, 3) = TextBox4
ActiveCell.Offset(0, 3).Select
Unload Me
End Sub
Private Sub UserForm_Initialize()
Label20 = ActiveCell.Offset(0, 0)
Label2 = ActiveCell.Offset(0, 1)
Label24 = ActiveCell.Offset(0, 2)
Label26 = ActiveCell.Offset(0, 5)
Min = Val(Me.Label26.Caption)
Label27 = ActiveCell.Offset(0, 6)
Max = Val(Me.Label27.Caption)
End Sub
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox4 <> "" Then
MaVal = Me.TextBox4.Value
If MaVal > Max Or MaVal < Min Then UserForm2.Show
End If
End Sub
A+