Bonjour Latige, Mallory, le Forum
Pour Latige, on peut faire comme ceci :
Option Explicit
Private Sub CommandButton1_Click()
With Me.TextBox1
If IsDate(.Value) Then
If CDate(.Value) >= 32874 And CDate(.Value) <= 38718 Then
MsgBox "C'est Bon"
Else
MsgBox "La Date " & Format(.Value, "DD/MM/YYYY") & " est hors fourchette"
End If
Else
MsgBox "Veuillez Saisirune Date car " & .Text & " n'est pas une date !"
End If
End With
End Sub
Pour toi Mallory, c'est un peu tordu, mais j'ai plus le temps !! lol
Option Explicit
Private Sub CommandButton1_Click()
Dim TheValue As Double
With Me.TextBox1
If IsNumeric(.Value) Then
TheValue = .Value
If Not Round(TheValue, 0) <> TheValue Then
If TheValue >= 1000 And TheValue <= 4045 Then
MsgBox "C'est Bon"
Else
MsgBox "La valeur " & TheValue & " est hors fourchette"
End If
Else
MsgBox "Veuillez Saisir un Entier ! et pas " & Format(TheValue, "####.#0")
End If
Else
MsgBox "Veuillez Saisir une Valeur numérique car " & .Text & " n'est pas une date !"
End If
End With
Exit Sub
End Sub
Bon Appétit
@+Thierry