View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Stubborn Date Format

masterworkbook.Sheets("shipper").Cells(7, 8).Value = cDate(strFormatDate)

should solve your problem.

"26/04/2006" can't be misinterpreted.

"03/04/2006" is ambiguous. It is a legitimate date either way.

--
Regards,
Tom Ogilvy


"OrientalPearl" wrote in message
oups.com...
The following statements were used previously:

strFormatDate = strDay & "/" & strMonth & "/" & strYear
masterworkbook.Sheets("shipper").Cells(7, 8).Value = strFormatDate

Clearly, strFormatDate is a string but conforming to the right Date
format. Together with Cells(7, 8) also with the right Date
format(dd/mm/yyyy), it should do as supposed.

I intend to agree with the US-centric feature(inherited from US
culture? ;-) of VBA as pointed out. Nevertheless, I am still amazed by
how powerful and penetrating it is in that it could manage to transform
"03/04/2006"(in April) to "04/03/2006"(in March) without any knowledge
backing up such an arbitrary transform?? Not weirdly enough, it does
know it should keep "26/04/2006" as it is(tried myself)!!

Thanks Ron and regards
Frank