View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default opening csv files

I've never seen moving a worksheet change the format or the value of a cell to
text.

You may want to step through your code and see if the dates are coming in
correctly.

With .csv files, it's very important that the dates you import match the same
format as the windows setting: mdy or dmy or ymd or...

If these don't match, then text like:

01/02/2005
could be brought in as Jan 2, 2005 or Feb 1, 2005.

And
13/02/2005
could be brought in as text--if windows was set up for mdy.



wrote:

I am opening csv files using:
Workbooks.Open Filename:="I:\My Documents\Soccer Predictions\E0.csv"
Sheets("E0").Move Befo=Workbooks("csvimport.xls").Sheets(1)

Workbooks.Open Filename:="I:\My Documents\Soccer
Predictions\E1.csv"
Sheets("E1").Move Befo=Workbooks("csvimport.xls").Sheets(1)

Workbooks.Open Filename:="I:\My Documents\Soccer
Predictions\E2.csv"
Sheets("E2").Move Befo=Workbooks("csvimport.xls").Sheets(1)

Workbooks.Open Filename:="I:\My Documents\Soccer
Predictions\E3.csv"
Sheets("E3").Move Befo=Workbooks("csvimport.xls").Sheets(1)

Workbooks.Open Filename:="I:\My Documents\Soccer
Predictions\Ec.csv"
Sheets("Ec").Move Befo=Workbooks("csvimport.xls").Sheets(1)

Workbooks.Open Filename:="I:\My Documents\Soccer
Predictions\sc0.csv"
Sheets("sc0").Move Befo=Workbooks("csvimport.xls").Sheets(1)
In these files col b contains dates, before they are moved these dates
are as 01/01/2005, but after moving some change to 01/01/05 and are
text. Ive tried just opening the files and moving them myself but the
ssame happens. Whats throwing me is, the files are in my documents, and
if I open each one manually and drag them into the destination folder
myself, I have no problems with the dates. Any Suggestions.
Regards Robert

As Aside is there any online courses for vba excel?


--

Dave Peterson