Private Sub UserForm_Activate()
Dim LaDate As Date, Lannee As Long
LaDate = Date
Lannee = Year(LaDate)
TextBox1.Value = Lannee
End Sub
Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If TextBox1.TextLength = 4 Then
laddn = TextBox1 + "-"
End If
End Sub
Private Sub TextBox2_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If TextBox2.TextLength = 2 Then
laddn = laddn + TextBox2 + "-"
End If
End Sub
Private Sub TextBox3_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If TextBox3.TextLength = 2 Then
laddn = laddn + TextBox3
Range("i" & mavariable).Value = laddn
Range("b" & mavariable).Select
laddn = ""
Unload UserForm4
Exit Sub
End If
End Sub