Copy/Paste dates from CSV file - date format error?
The only thing that might be a problem is if the workbook you're importing to is
set to use the 1904 date system.
If you're building the .csv file, maybe you could create a formula for that
field:
1234,"qwer qwer",=date(2007,12,25),"more stuff"
(untested!)
As long as you stay in the English language!
And if that formula string is brought in as text, you could
select that range
edit|replace
what: =
with: =
replace all
"michael.beckinsale" wrote:
Hi All,
Problem solved.(I think)
Trawled the newsgroup and confirmed that this is a known issue that
has not been addressed up to XL2003, l dont know about XL2007.
There appear to be plenty of suggestions for a workaround when
importing a file. Most of these revolve around re-saving the file &
importing as a text file or changing date values to date serial
values.
In my project l want to copy / paste values from a csv file using
VBA .To overcome the problem l have added code which formats the csv
file date column to text (ie shows the date serial value), then when
the data has been pasted into the target file l format the date column
as dd/mm/yy. I have tested this with several samples and all appears
to be OK. I have paid particular attention to days 1 to 12.
Can anybody see any potential risk with this strategy? This project is
very date intensive and l really want to avoid potential date errors
from the outset.
Regards
Michael beckinsale
--
Dave Peterson
|