Thread: Import txt file
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Manville Bill Manville is offline
external usenet poster
 
Posts: 473
Default Import txt file

Hasan Cansü wrote:
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