Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsDate(TextBox1.Text) Then
TextBox1.Value = ""
Ln1 = "There was as error in the date entry." & vbNewLine
Ln2 = "Please enter a valid date."
Style = vbOKOnly
Title = "Date entry error"
MsgBox Ln1 & Ln2, Style, Title
Else: TextBox1.Text = Format(TextBox1.Text, "dd-mmm-yy")
End If
End Sub