View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Price[_2_] David Price[_2_] is offline
external usenet poster
 
Posts: 2
Default 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"