I got this code from somewhere to format the date to dd/mm/yy,
Private Sub txtCommence_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Private Sub txtCommence_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim a() As String
Dim b(2) As String
If Not IsDate('Private Sub txtCommence_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim a() As String
Dim b(2) As String
If Not IsDate(txt!!!.Value) Then
MsgBox "Enter valid Date: e.g. 01/01/02"
Exit Sub
End If
a = Split((CStr(CDate(txt!!!.Value.Value))), "/")
b(0) = a(0)
b(1) = a(1)
b(2) = a(2)
txt!!!.Value.Value = Join(b(), "/")
End Sub) Then
MsgBox "Enter valid Date: e.g. 01/01/02"
Exit Sub
End If
a = Split((CStrCDatetxt!!!.Value.Value))), "/")
b(0) = a(0)
b(1) = a(1)
b(2) = a(2)
txt!!!.Value.Value = Join(b(), "/")
End Sub
it doesn't work to well as the date keeps on changing back to mm/dd/yy. Does any body know how to make the date stay in the dd/mm/yy format.
Private Sub txtCommence_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Private Sub txtCommence_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim a() As String
Dim b(2) As String
If Not IsDate('Private Sub txtCommence_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim a() As String
Dim b(2) As String
If Not IsDate(txt!!!.Value) Then
MsgBox "Enter valid Date: e.g. 01/01/02"
Exit Sub
End If
a = Split((CStr(CDate(txt!!!.Value.Value))), "/")
b(0) = a(0)
b(1) = a(1)
b(2) = a(2)
txt!!!.Value.Value = Join(b(), "/")
End Sub) Then
MsgBox "Enter valid Date: e.g. 01/01/02"
Exit Sub
End If
a = Split((CStrCDatetxt!!!.Value.Value))), "/")
b(0) = a(0)
b(1) = a(1)
b(2) = a(2)
txt!!!.Value.Value = Join(b(), "/")
End Sub
it doesn't work to well as the date keeps on changing back to mm/dd/yy. Does any body know how to make the date stay in the dd/mm/yy format.