Hello,
I have some code to check if textbox contains a date and if so, write it to the spreadsheet, as so (the top line):
However, it allows US dates through (i.e. I only want it to accept DD/MM/YYYY; but it will also accept MM/DD/YYYY etc.).
Is there a way round this?
I have some code to check if textbox contains a date and if so, write it to the spreadsheet, as so (the top line):
VBA Code:
If IsDate(TB_Date_of_Decs.Text) Then
ActiveSheet.Cells(.Row, Range("Date_of_Decs").Column) = CDate(TB_Date_of_Decs.Text)
Else
MsgBox ("You did not enter a valid date in the date of decs field."), vbCritical + vbOKOnly
End If
However, it allows US dates through (i.e. I only want it to accept DD/MM/YYYY; but it will also accept MM/DD/YYYY etc.).
Is there a way round this?