Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Current Month with real date | Excel Worksheet Functions | |||
Highlight the cell date of current month | Excel Discussion (Misc queries) | |||
How do I show the current month in a date field? | Excel Discussion (Misc queries) | |||
Current date formula based on month | Excel Discussion (Misc queries) | |||
Pulling a date in the current month | Excel Worksheet Functions |