Public Num_Tmp As Double
Private Sub TextBox73_Change()
On Error GoTo Pas_Num
If TextBox73 <> vbNullString Then
Num_Tmp = CDbl(TextBox73)
TextBox74.Enabled = True
TextBox75.Enabled = True
Else
TextBox74.Enabled = False
TextBox75.Enabled = False
CommandButton3.Enabled = False
Exit Sub
End If
On Error GoTo 0
Exit Sub
Pas_Num:
MsgBox ("Merci de saisir une valeur numérique")
TextBox73 = Mid(TextBox73, 1, Len(TextBox73) - 1)
End Sub
Private Sub TextBox74_Change()
If Len(TextBox74) = 0 Then Exit Sub
If Asc(Right(TextBox74, 1)) < 48 Or Asc(Right(TextBox74, 1)) > 57 Then
MsgBox ("Merci de saisir uniqument des entiers naturels")
TextBox74 = Mid(TextBox74, 1, Len(TextBox74) - 1)
End If
If Len(TextBox74) > 2 Then
MsgBox ("Nombre trop élevé")
TextBox74 = Mid(TextBox74, 1, Len(TextBox74) - 1)
End If
End Sub
Private Sub TextBox75_Change()
If Len(TextBox75) = 0 Then Exit Sub
If Asc(Right(TextBox75, 1)) < 48 Or Asc(Right(TextBox75, 1)) > 57 Then
MsgBox ("Merci de saisir uniqument des chiffres")
TextBox75 = Mid(TextBox75, 1, Len(TextBox75) - 1)
End If
If Len(TextBox75) < 12 Then
CommandButton3.Enabled = False
Else
CommandButton3.Enabled = True
End If
End Sub
Private Sub UserForm_Initialize()
TextBox74.Enabled = False
TextBox75.Enabled = False
CommandButton3.Enabled = False
End Sub