Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with dates - export to .csv files

Would be obliged for any ideas in relation to the following:

I have a fairly large vba routine which separates data and copies i
into between 2 and 10 different worksheets. The remainder of the cod
runs perfectly.

The data is made up of four columns

data1 data2 date time

The data is imported from a text file (format dd:mm:yyyy) and displaye
in the format dd/mm/yyyy. This format is then copied into th
respective worksheets and is still displayed as dd/mm/yyyy.

The code then saves each sheet to a csv file using the following code:

If Worksheets("Data").Range("K" & c + 5) < "" Then
xlsfpath = Worksheets("Data").Range("Q5").Value
Sheets("No" & c & "up").Select
ActiveWorkbook.SaveAs FileName:=xlsfpath
Worksheets("Data").Range("O" & c + 5).Value & ".csv"
FileFormat:=xlCSV, CreateBackup:=False
Sheets("No" & c & "down").Select
ActiveWorkbook.SaveAs FileName:=xlsfpath
Worksheets("Data").Range("P" & c + 5).Value & ".csv"
FileFormat:=xlCSV, CreateBackup:=False
End If

taking the filename from a cell on the master sheet ("Data") if ther
is data to be written. This loops through to write up to ten .csv file
to disk.

The code works perfectly apart from the date aspect which outputs th
third column as m/d/yy.

Ironically if I do a manual FileSave As *.csv for each sheet the dat
is output perfectly as dd/mm/yyyy.

My computer has the international settings as UK and the formatting fo
the column concerned is correctly set to dd/mm/yyyy. It is only whe
the vba does the job that it goes wrong.

As I said earlier any help would be much appreciated.

Iain Thomso

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with dates - export to .csv files

Unfortunetly, I am unable to help, only offer that I'm having the sam
difficulty splitting out a couple of Tab-delimeted text files an
keeping the dates as they are when using the manual Save As process

--
Message posted 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
export sheets to multiple new files Tanya Excel Discussion (Misc queries) 8 April 20th 09 10:00 PM
Export to XML from different worksheets (to different files) cfmartin76 Excel Worksheet Functions 0 January 26th 09 11:15 PM
Problem with copying dates between files kmp28385 Excel Discussion (Misc queries) 1 January 9th 08 07:52 AM
There's no export to dbf files from XL2007? Kluster Excel Discussion (Misc queries) 11 April 11th 07 03:48 AM
export gif file files k2sarah Charts and Charting in Excel 1 December 5th 05 04:43 PM


All times are GMT +1. The time now is 12:15 AM.

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

About Us

"It's about Microsoft Excel"