Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
export sheets to multiple new files | Excel Discussion (Misc queries) | |||
Export to XML from different worksheets (to different files) | Excel Worksheet Functions | |||
Problem with copying dates between files | Excel Discussion (Misc queries) | |||
There's no export to dbf files from XL2007? | Excel Discussion (Misc queries) | |||
export gif file files | Charts and Charting in Excel |