Date changes when copied and pasted

J

JC

I am having a problem where when copying rows that contains a date field into
another workbook, the date actually changes (usually by minus 4 years and 1
day eg 04/10/2008 becomes 03/10/2004). The first workbook is an export from
another program which we receive by email and is a csv file when received.
It then has a VBA macro run over it that deletes unwanted columns, rearranges
columns and formats some columns to text (not the date field) before pasting
into another workbook.

The problem is intermittent but seems to be dependent on what order the
workbooks are opened in. Otherwise can only be solved by either closing
Excel and starting again and sometimes only by restarting the computer. Can
anyone help!
 
D

Dave Peterson

Saved from a previous post:

One workbook was using a base year of 1900 and the other was using 1904.
(tools|options|calculation tab|1904 date system)

One way to add those four years back is to find an empty cell, put 1462 into
that cell.

Copy that cell.

Select your range that contains the dates. Edit|PasteSpecial|click Add (in the
operation box).

You may have to reformat the cell as a date (mine turned to a 5 digit number).
But it should work.

You may want to do it against a copy...just in case.

(I'm not sure which one you'll fix. You may want to edit|pastespecial|click
subtract.)

Most windows users use 1900 as the base date. Mac users (mostly??) use 1904 as
the base date.
 
P

Peo Sjoblom

It might be a good idea to format the cell where the OP puts the 1462 as a
date as well,
that way there won't be a serial number as the result


--


Regards,


Peo Sjoblom
 
J

JC

Thanks very much. That makes sense. I was aware of the PC/Mac difference
but it didn't register as a possible cause. Will try your solution and hope
all goes well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top