Hi I have created a userform but I am having extensive problems with the date formats.
My system is set to UK and short date is set to: DD/MM/YYYY
When I used code to add the values in the userform to the spreadsheet, any that contained a date format would revert to the US format.
So I finally figured out to use DateValue to format it correctly for example:
.Cells(lRow, 2).Value = DateValue(Me.yomreferdate.Value)
This adds the data in the correct format. However when I retrieve the information using a change event for example:
Me.yomreferdate.Value = ws.Range("yomid").Cells(Me.yomidlup.ListIndex + 1, 1).Offset(0, 1)
Me.yomreferdate.Value = Format(Me.yomreferdate.Value, "dd/mm/yy")
' or -- Me.yomreferdate.Value = DateValue(Me.yomreferdate.Value)
They return UK formats if the month is less than 12 then revert to US if the date exceeds 12???????
I have tried alsorts to try and rectify it but I am really struggling can anyone offer me some advice please?
Thank you in advance.
Bookmarks