snuggles79
New Member
- Joined
- Sep 25, 2006
- Messages
- 8
On my userform I have a "date" textbox and have put the following coding into visual basic:
Private Sub contdate_Exit
If Not IsDate(contdate) Then MsgBox "Input must be a date in the format: 'dd/mm/yyyy'" Cancel = True
Else contdate = Format(contdate, "dd/mm/yyyy")
End If
End Sub
Now, when the date field is filled in and the data transferred to the spreadsheet an oddity happens.
If the "date" part is above 12 then there are no problems and it enters it as dd/mm/yyyy but, if the "date" part is 12 or lower it gets put in as mm/dd/yyyy for some bizarre reason.
Any ideas how I can correct this?
I have formatted the cells as dd/mm/yyyy and it makes no difference.
Thanks in advance guys
Private Sub contdate_Exit
If Not IsDate(contdate) Then MsgBox "Input must be a date in the format: 'dd/mm/yyyy'" Cancel = True
Else contdate = Format(contdate, "dd/mm/yyyy")
End If
End Sub
Now, when the date field is filled in and the data transferred to the spreadsheet an oddity happens.
If the "date" part is above 12 then there are no problems and it enters it as dd/mm/yyyy but, if the "date" part is 12 or lower it gets put in as mm/dd/yyyy for some bizarre reason.
Any ideas how I can correct this?
I have formatted the cells as dd/mm/yyyy and it makes no difference.
Thanks in advance guys