Private Sub TextBox1_AfterUpdate()
Dim D As Double
D = IIf(IsNumeric(TextBox1.Value), TextBox1.Value, 0)
If D < 15000 Or D > 100000 Then
MsgBox "la valeur doit être comprise entre 15.000 et 100.000"
TextBox1.Text = ""
TextBox1.SetFocus 'Bug Excel ? fonctionne pas ?
End If
End Sub
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
D = IIf(IsNumeric(TextBox1.Value), TextBox1.Value, 0)
If D < 15000 Or D > 100000 Then MsgBox "non": Cancel = True
End Sub
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
'Pour éviter double appel.
If TextBox1.Text = "" Then Exit Sub
Dim D As Double
D = IIf(IsNumeric(TextBox1.Value), TextBox1.Value, 0)
If D < 15000 Or D > 100000 Then
MsgBox "la valeur doit être comprise entre 15.000 et 100.000"
TextBox1.Text = ""
Cancel = True
End If
End Sub
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
Select Case TextBox1.Value
Case Not IsNumeric(TextBox1.Value), Is < 15000, Is > 100000
MsgBox "non": Cancel = True
End Select
End Sub
27 oct. 2013 à 18:58
Modifié par ucfoutu le 27/10/2013 à 19:02
Il y est ce code, non ?