Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wrong dates in VBA

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...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Wrong dates in VBA

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

"Oz Viking" wrote:

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...

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Wrong dates in VBA

On Tue, 15 Sep 2009 19:25:01 -0700, Oz Viking
wrote:

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Wrong dates in VBA

Are you copy|pasting or assigning values?

If you're assigning values:

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



Oz Viking wrote:

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...


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding columns using dates, but getting wrong data Griffey5 Excel Worksheet Functions 3 January 8th 09 03:29 AM
Dates Being displayed the wrong way around. NateBuckley Excel Programming 2 April 13th 08 02:26 PM
Dates appear wrong in my chart Rockman Charts and Charting in Excel 1 January 11th 08 11:46 PM
dates automatically formatted wrong bigajosepi Excel Discussion (Misc queries) 1 August 22nd 06 04:56 AM
I get wrong dates when i paste from a different sheet into a new s mmollat Excel Discussion (Misc queries) 2 January 6th 05 07:35 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"