Problema in reading from text file into Excel using OpenText

Parag

New Member
Hello !

This is first time I am writing to this forum. I am not sure which group of the list it will fit into.

I am facing a problem with OpenText method of VBA of office 97 (MS Excel).

I have a text file containing data, columns are separated using tab. Some columns are having dates in dd/mm/yyyy format.

When I open the text file in excel using OpenText method, the dates are automatically shown in MM/DD/YY.
If the date in the text file is 05/12/2000 it is shown as 12/05/00 but if the date is 14/01/2000 it remains as a string as it cannot recognize the month.
Also the column that contains a date is not fixed, but as the column header I have a character indicating the type of the column (in the text file)
I have tried setting NumberFormat for the cells, and the formulaR1C1 property too.
I don't want the column in the imported file to show the date in MM/DD/YY format rather it should be displayed in DD/MM/YYYY format too.

Any solution possible ? (Is this the correct group to ask the question ?)

Thanks in advance,

Parag
 
U

Unregistered

Guest
Why not swap the months/dates before hand using text string manipulation? Excel should read them correctly.(?)

I do not follow this forum but I can be emailed at jdaugela@hotmail.com.
 
U

Unregistered

Guest
I have just started using COM objects and in my Excel investigation I found that

chWorksheet:Columns("L:L"):NumberFormat = "dd/mm/yyyy".

would amend the date format in column L to the format you require
 
Top