Importing Text file into Excel 2003

  • Thread starter Thread starter Ray
  • Start date Start date
R

Ray

Can I get some sample VBA code which would import a text file into Excel
2003.

Thanks,
Ray
 
Workbooks.Open "C:\MyFolder\MyFile.Txt"
or if you have Excel 2000 or later, turn on the macro recorder and to

Data=>Get External Data (or Import External Data) and navigate to the
Import Text file option and import your data manually.

If you need parse the text file, then for the first method turn on the macro
recorder as well and go through the text import wizard - it will record
arguments to the OpenText method.
 
Great idea. Thanks Tom!

Tom Ogilvy said:
Workbooks.Open "C:\MyFolder\MyFile.Txt"
or if you have Excel 2000 or later, turn on the macro recorder and to

Data=>Get External Data (or Import External Data) and navigate to the
Import Text file option and import your data manually.

If you need parse the text file, then for the first method turn on the
macro
recorder as well and go through the text import wizard - it will record
arguments to the OpenText method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top