Henrybukowski
New Member
- Joined
- Apr 16, 2013
- Messages
- 29
Dear all,
I have a problem with american date formats always reoccuring. I have seen other posts on this problem but none matching my particular issue.
I have a userform in which my users enter data which is then added to the excel spreadsheet.
Sometimes they need to amend this data so we have made their data editable - it gets put back into the userform so that changes can be made.
The issue is with dates. These are entered as dd/mm/yyyy but when they are then added to the userform they always go back to mm/dd/yyyy
The code to put the userfrom data to the spreadsheet is as follows:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit;">
[/FONT]
...Then to put it back into the form for editing:
I made some progress by specifying instead of the first line:
Using DataValue or CDate. This works to an extent because data is now added in the format dd/mm/yyyy - hooray!
However, when put back into the userform it still goes back in the form mm/dd/yyyy!!!!
Is there a way I can override this American date format which keeps coming back?
Many thanks in advance
Henry
NB: Linked: http://www.excelforum.com/excel-programming-vba-macros/1149872-date-always-reverts-to-american-format-in-userform.html
I have a problem with american date formats always reoccuring. I have seen other posts on this problem but none matching my particular issue.
I have a userform in which my users enter data which is then added to the excel spreadsheet.
Sometimes they need to amend this data so we have made their data editable - it gets put back into the userform so that changes can be made.
The issue is with dates. These are entered as dd/mm/yyyy but when they are then added to the userform they always go back to mm/dd/yyyy
The code to put the userfrom data to the spreadsheet is as follows:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit;">
Code:
ws.Cells(iRow, 28).Value = Me.refdate.Value </code>[/COLOR][COLOR=#333333][FONT=monospace]
...Then to put it back into the form for editing:
Code:
[/FONT][/COLOR][COLOR=#333333]<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit;">.refdate.Value = Cells(ActiveCell.Row, "AB").Value </code>[/COLOR][COLOR=#333333][FONT=monospace]
Code:
[/FONT][/COLOR][COLOR=#333333]<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit;">ws.Cells(iRow, 75).Value = DateValue(Me.phdat.Value)</code>[/COLOR][COLOR=#333333][FONT=monospace]
Using DataValue or CDate. This works to an extent because data is now added in the format dd/mm/yyyy - hooray!
However, when put back into the userform it still goes back in the form mm/dd/yyyy!!!!
Is there a way I can override this American date format which keeps coming back?
Many thanks in advance
Henry
NB: Linked: http://www.excelforum.com/excel-programming-vba-macros/1149872-date-always-reverts-to-american-format-in-userform.html