Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using vba copy data from .csv file into an excel spreadsheet

Hi

I'm trying to copy (several columns and several rows) data from a .csv
file into an excel spreadsheet which also happens to contain columns of
dates.

I can't seem to be able to get around getting warped output in Excel.
Ie, the dates are copied and pasted just fine whilst others get
transferred from Australian dates (ie dd/mm/yyy) to American dates
(mm/dd/yyyy) and others do not even get recognised as numbers but
rather text.

I have tried using a couple of ways of getting around this for example,


(1) by formatting the data in the .csv file into dd-mmm-yy format
before copying and pasting.

(2) using a formula in the excel spreadsheet to =(required cell in the
.csv)

Each time the date gets warped.

However, this doesn't seem to be an issue when I manually cut and paste
the data or manually use a formula.

Has anyone else ever had this problem and managed to overcome it?

Much appreciated
Vineeta



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default using vba copy data from .csv file into an excel spreadsheet

When VBA touches the data, it uses a US centric interpretation of a date.
The usual way is to use the date serial number which is what is actually
stored and which isn't ambiguous. If you are accessing the cells
individually, use the Value2 property for dates, rather than the Value
property. (you can use the value2 property for all cells - as it won't be
different from Value for things that are not dates or currency.

--
Regards,
Tom Ogilvy



"vineeta" wrote in message
...
Hi

I'm trying to copy (several columns and several rows) data from a .csv
file into an excel spreadsheet which also happens to contain columns of
dates.

I can't seem to be able to get around getting warped output in Excel.
Ie, the dates are copied and pasted just fine whilst others get
transferred from Australian dates (ie dd/mm/yyy) to American dates
(mm/dd/yyyy) and others do not even get recognised as numbers but
rather text.

I have tried using a couple of ways of getting around this for example,


(1) by formatting the data in the .csv file into dd-mmm-yy format
before copying and pasting.

(2) using a formula in the excel spreadsheet to =(required cell in the
csv)

Each time the date gets warped.

However, this doesn't seem to be an issue when I manually cut and paste
the data or manually use a formula.

Has anyone else ever had this problem and managed to overcome it?

Much appreciated
Vineeta



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
copy data for match word from one file to another file mishak Excel Worksheet Functions 1 December 2nd 09 02:11 AM
using an excel spreadsheet as the data file for a mail merge pamelaClaire New Users to Excel 3 March 20th 07 05:24 PM
How do I copy spreadsheet data as shown to another spreadsheet? trainer07 Excel Discussion (Misc queries) 2 August 7th 06 09:39 PM
Copy data from one Excel spreadsheet to another gvih2g2 Excel Discussion (Misc queries) 2 March 15th 06 01:26 PM
How to open another Excel spreadsheet to copy data into current spreadsheet ? Ricky Pang Excel Programming 0 July 13th 03 01:59 PM


All times are GMT +1. The time now is 01:59 PM.

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

About Us

"It's about Microsoft Excel"