Import txt file

  • Thread starter Thread starter =?iso-8859-1?Q?Hasan_Cans=FC?=
  • Start date Start date
?

=?iso-8859-1?Q?Hasan_Cans=FC?=

I have a macro to import data from a text file (csv with
extension txt), with dates as dd/mm/yyyy in the first
column and values in the others.

When I run it, all the data is imported properly except
that sum of the dates get the date format in the cell and
sum stay as standard. If I use German regional settings
(which I usually do), the dates with date cell format also
turn to mm/dd/yyyy.

Does anyone have a clue what the problem might be and how
to overcome?

Thanks
Hasan
 
Hasan said:
I have a macro to import data from a text file (csv with
extension txt), with dates as dd/mm/yyyy in the first
column and values in the others.

When I run it, all the data is imported properly except
that sum of the dates get the date format in the cell and
sum stay as standard. If I use German regional settings
(which I usually do), the dates with date cell format also
turn to mm/dd/yyyy.

I suggest you record a macro while doing File / Open on this file.
The import wizard should appear.
Specify Delimited / Next / Comma / Next
Select the first column and specify Date: DMY / Finish

Then copy the relevant part of the recorded macro into your macro.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup
 
Back
Top