Wrong dates in VBA

O

Oz Viking

I have columns with of dates. eg 1/07/2009 meaning 1 July 2009. When I copy
this date using VBA and paste it to another range, it changes to 7/01/2009
and produces incorrect reports ie as 7 January 2009. It is obviously a US
date thing but I don't know how to fix it.

Please help...
 
F

FSt1

hi
i cannot duplicate your problem. i pre formated a cell to Norwegian(Bokmal)
and ran the following code.......
Range("B7").Copy Destination:=Range("B8")

and vb copied the date and format to the new cell meaning the date format
didnot change.

post the code you are using.

Regards
FSt1
 
R

Ron Rosenfeld

I have columns with of dates. eg 1/07/2009 meaning 1 July 2009. When I copy
this date using VBA and paste it to another range, it changes to 7/01/2009
and produces incorrect reports ie as 7 January 2009. It is obviously a US
date thing but I don't know how to fix it.

Please help...

You will need to post the code you are using, along with your Windows Regional
settings (from Control Panel).

Also, are the "dates" true Excel dates? or Text strings?

--ron
 
D

Dave Peterson

Are you copy|pasting or assigning values?

If you're assigning values:

worksheets("Sheet999").range("A1").value2 _
= worksheets("sheet888").range("b2").value2
 
Top