Option Explicit
Private LaDate As Date 'Variable Publique niveau UserForm
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
With Me.TextBox1
If .Value = '' Then Exit Sub 'On sort si Vide
If Not IsDate(.Value) Then
.SelStart = 0
.SetFocus
.SelLength = Len(.Text)
Cancel = True
Else
LaDate = .Value
.Text = Format(.Value, 'yyyy-mm-dd')
End If
End With
End Sub