Forum Discussion
ken donovan
Nov 07, 2018Copper Contributor
Date formatting form with VBA to excel worksheet
Hi, I have built a VBA form with a date input field. When I save the form the date formatting changes from the date that I entered 01-06-2018 to 06-01-2018 the date that appears in the excel cell. ...
Sanjay Gandhi
Nov 08, 2018Copper Contributor
Hi Ken,
1. Please match your Region settings exactly as dd-MM-yyyy and not as dd/MM/yyyy.
2. You don't need this statement sh.Range("C6", "C2000").NumberFormat = "dd-MM-yyyy"
3. While saving your date, you can use Cells(Row, Column).Value = DateValue("01-06-2018") or if you use Range then you can use Range(CellAddress).Value instead of Cells(Row,Column).Value.
Hope this helps. This works on my Comp. Windows 10, and Office 365.
Regards,
San.