stucamps
Board Regular
- Joined
- Jul 3, 2003
- Messages
- 114
I have searched on the forums and tried different solutions to this common problem but to no avail.
Basically I have an input box where the user enters a date in the format "dd/mm/yyyy" and this is being returned as "mm/dd/yyyy"
I have checked my regional settings via the Control Panel and have reformatted the excel cell to "dd/mm/yyyy" both in VBA and also manually in Excel - Format>Cells>etc.
The Code I have for the InputBox is below and the formatting also
(I have included two versions of the InputBox but both still throw up the wrong date format)
Month = ThisWorkbook.Sheets(1).Range("$G$7").Value
Dim d
d = Format(InputBox("Please Enter the Inception Date for the new Share Class series you have added", "Date Entry", Format(Month, "dd/mm/yy")), "dd/mm/yyyy")
ActiveSheet.Range("A65536").End(xlUp).Offset(-14, 0).Value = Format(d, "dd/mm/yyyy")
or alternatively used this InputBox suggestion:
d = CDate(InputBox("Please Enter the Inception Date for the new Share Class series you have added", "Date Entry", Format(Month, "dd/mm/yy")))
I am trying to enter the date 1st May 2005 - as 01/05/2005 - but it is being returned as 05/01/2005.
Can someone please point out something I am missing here!
Thanks,
Stuart
Basically I have an input box where the user enters a date in the format "dd/mm/yyyy" and this is being returned as "mm/dd/yyyy"
I have checked my regional settings via the Control Panel and have reformatted the excel cell to "dd/mm/yyyy" both in VBA and also manually in Excel - Format>Cells>etc.
The Code I have for the InputBox is below and the formatting also
(I have included two versions of the InputBox but both still throw up the wrong date format)
Month = ThisWorkbook.Sheets(1).Range("$G$7").Value
Dim d
d = Format(InputBox("Please Enter the Inception Date for the new Share Class series you have added", "Date Entry", Format(Month, "dd/mm/yy")), "dd/mm/yyyy")
ActiveSheet.Range("A65536").End(xlUp).Offset(-14, 0).Value = Format(d, "dd/mm/yyyy")
or alternatively used this InputBox suggestion:
d = CDate(InputBox("Please Enter the Inception Date for the new Share Class series you have added", "Date Entry", Format(Month, "dd/mm/yy")))
I am trying to enter the date 1st May 2005 - as 01/05/2005 - but it is being returned as 05/01/2005.
Can someone please point out something I am missing here!
Thanks,
Stuart