Private Sub TextBox1_Change()
'nlet = Len(TextBox1)
'If Right(TextBox1, 1) = "," Then MsgBox "Saisir un Point": TextBox1 = Mid(TextBox1, 1, nlet - 1)
If Len(TextBox1) = 2 Then TextBox1 = TextBox1 & "/"
End Sub
Private Sub TextBox1_Change()
If Len(TextBox1) = 2 or Len(TextBox1) = 5 Then TextBox1 = TextBox1 & "/"
End Sub
Private Sub TextBox1_Change()
'Pour limiter le nombre de caratère à 10
TextBox1.MaxLength = 10
If Len(TextBox1) = 2 or Len(TextBox1) = 5 Then TextBox1 = TextBox1 & "/"
End Sub
Private Sub TextBox1_Change()
'Ti 10-01-03, notre très cher et regretté Thierry Pourtier
Dim Texte As String
Texte = TextBox1.Text
Select Case Len(Texte)
Case 2, 5
Texte = Texte & "/"
End Select
TextBox1.Text = Texte
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim Container As Variant
Container = Split(TextBox1.Text, Application.International(xlDateSeparator))
If UBound(Container) <> 2 Then GoTo TheEnd
If Not IsDate(TextBox1.Value) Then GoTo TheEnd
Exit Sub
TheEnd:
'MsgBox "La Date n'est pas valide" 'Si necessaire
With TextBox1
.SetFocus
.SelStart = 0
.SelLength = Len(TextBox1)
End With
Cancel = True
End Sub
Dim C As Boolean
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyCode
Case Is = 8
C = True
Case Is = 13, 96 To 105
Case Else
KeyCode = 0
End Select
End Sub
Private Sub TextBox1_KeyUP(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyCode
Case Is = 46
C = True
TextBox1 = ""
End Select
End Sub
Private Sub TextBox1_Change()
If Not C Then
With TextBox1
Select Case Len(.Text)
Case 2, 5
.Text = .Text & "/"
End Select
End With
Else
C = False
End If
End Sub
Private Sub TextBox1_Change()
'nlet = Len(TextBox1)
'If Right(TextBox1, 1) = "," Then MsgBox "Saisir un Point": TextBox1 = Mid(TextBox1, 1, nlet - 1)
If Len(TextBox1) = 2 Then TextBox1 = TextBox1 & "/"
Application.EnableEvents = False
If Len(TextBox1) = 5 Then TextBox1 = TextBox1 & "/"
Application.EnableEvents = True
End Sub
bah justement y pas de clavier, lol
j'ai créé un petit clavier virtuel ( écran tactile) et après si y a trop de touche ca devient compliqué , y en a qu'on jamais touché un clavier.
Private Sub CB_Click()
Dim dat As Variant
With CB.Parent.Controls(CB.Parent.Tag)
If CB.Name <> "C12" Then .Text = .Text & CB.Caption _
Else .Text = Left(.Text, IIf(Len(.Text), Len(.Text), 1) - 1)
Range("A" & Right(.Name, 1)) = "" 'RAZ
dat = ExecuteExcel4Macro("DATEVALUE(""" & .Text & """)")
If IsNumeric(dat) Then Range("A" & Right(.Name, 1)) = CDate(.Text)
.SetFocus
End With
End Sub