ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   a simple question (https://www.excelbanter.com/excel-programming/275794-re-simple-question.html)

David Price[_2_]

a simple question
 
I had a similar problem.

The first set of dates being 01-05-2003 to 12-05-2003 in 2002 may be getting
intrepreted as "mm-dd-yyyy" format, rather than "dd-mm-yyyy" as you appear
to be expecting, therefore making this Jan 5, Feb 5 etc to Dec 5.

Of course there is no 13th month in our calendar (there is in some), so VBA
treats 13-05-2003 as a string - not a date at all.

The obvious answer is to treat the incoming record as a string, and use
Left, Mid & Right string functions to populate the DateValue(dd,mm,yyyy)
function in VBA. Therefore leaving no room for international
misunderstandings to creep into your coding.

Regards

Dave


"Question deleted from response"






All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com