View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Frank_Hamersley Frank_Hamersley is offline
external usenet poster
 
Posts: 12
Default VBA Setting .Value to a date does not respect local system setting

"keepITcool" wrote in message
vba uses USamerican internally


Par for the course I guess!

using a range's value2 property to insert dates
will solve your uncertainty..


Didn't seem to change the outcome at all. Note that I am casting from a
String rather than Date.

ActiveCell.Value2 = "1/2/2003" produces 02-Jan-2003
ActiveCell.Value2 = #1/2/2003# produces 37623 which formats as 02-Jan-2003

as it will insert the value as a number rather than an (interpreted) date


Looks like I will have to keep parsing the string and casting it myself!

Thanks for the input.
Frank.