Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default code pasting a date changes date format in current month only

I wrote some code to take a date from a cell on one sheet to a cell on
another, using a variable, which worked perfectly – until I noticed
that, if the date was in the current month, the days and months were
reversed when it pasted it in!! i.e. it changed to American date format.
Regional seetings are fine, the format for the cell is correct. Having
no idea how this could happen, I checked what happened if I pasted
manually – no problem. Then what would happen without using a variable:
the following snippet of code shows the problem:

ActiveCell.Offset(0, 14).Value = "29/04/04" - 29/04/04
ActiveCell.Offset(1, 14).Value = "30/04/04" - 30/04/04
ActiveCell.Offset(2, 14).Value = "01/05/04" - 05/01/04
ActiveCell.Offset(3, 14).Value = "02/05/04" - 05/02/04
ActiveCell.Offset(4, 14).Value = "03/05/04" - 05/03/04

It happens in both Excel 97 and also tried in 95. Can anyone shed light
on this and provide a solution? Many thanks in anticipation.

Edward


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Current Month with real date Keyrookie Excel Worksheet Functions 2 December 1st 09 12:32 AM
Highlight the cell date of current month kashish Excel Discussion (Misc queries) 3 October 1st 09 11:50 AM
How do I show the current month in a date field? G-man[_2_] Excel Discussion (Misc queries) 5 May 27th 08 09:23 AM
Current date formula based on month Renz09 Excel Discussion (Misc queries) 2 May 5th 06 07:04 AM
Pulling a date in the current month Brian Excel Worksheet Functions 2 October 24th 05 05:57 PM


All times are GMT +1. The time now is 10:05 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"