Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
I have a CSV file with a column that contains a European date, say 11/03/2005 (11 March 2005). If I open this directly Excel displays the date as expected e.g. 11/03/2005. Because of the processing I need to do with other fields I rename the file, before opening to a .TXT file with.... Name "c:\test\audit.csv" As "c:\test\audit.txt" I then open the text file using....... Workbooks.OpenText Filename:="c:\test\audit.txt", Origin:=xlWindows _ , StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=True _ , Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _ Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 2), Array(9, 2)) The date now shows as 03/11/2005 !! - how can I stop this ? -- Cheers Nigel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok guys, I have it I did not realise the second element in the array is the
xlColumnDataType - setting this to option 4 loads the date as required. Sorry to trouble you -- Cheers Nigel "Nigel" wrote in message ... Hi All I have a CSV file with a column that contains a European date, say 11/03/2005 (11 March 2005). If I open this directly Excel displays the date as expected e.g. 11/03/2005. Because of the processing I need to do with other fields I rename the file, before opening to a .TXT file with.... Name "c:\test\audit.csv" As "c:\test\audit.txt" I then open the text file using....... Workbooks.OpenText Filename:="c:\test\audit.txt", Origin:=xlWindows _ , StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=True _ , Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _ Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 2), Array(9, 2)) The date now shows as 03/11/2005 !! - how can I stop this ? -- Cheers Nigel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
Date formatting | Excel Discussion (Misc queries) | |||
Formatting Date | Excel Discussion (Misc queries) | |||
date formatting | Excel Discussion (Misc queries) | |||
Date Colum Date Formatting & Validation | Excel Programming |