Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 8 Then
Effacer = True
Select Case Right(TextBox2, 1)
Case Is = ":", Is = "-", Is = " "
TextBox2 = Left(TextBox2, Len(TextBox2) - 1)
Cancel = True
Case Else
End Select
Effacer = False
Exit Sub
End If
If KeyCode < 96 Or KeyCode > 105 Then
Effacer = True
Application.EnableEvents = False
MsgBox ("Ne saisissez pas du texte!")
TextBox2 = IIf(Len(TextBox2) < 2, "", Replace(TextBox2, Right(TextBox2, 1), ""))
Application.EnableEvents = True
End If
End Sub