ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Importing Text file into Excel 2003 (https://www.excelbanter.com/excel-programming/313452-importing-text-file-into-excel-2003-a.html)

Ray[_13_]

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

Thanks,
Ray



Tom Ogilvy

Importing Text file into Excel 2003
 
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.

--
Regards,
Tom Ogilvy

"Ray" wrote in message
...
Can I get some sample VBA code which would import a text file into Excel
2003.

Thanks,
Ray





Ray[_13_]

Importing Text file into Excel 2003
 
Great idea. Thanks Tom!

"Tom Ogilvy" wrote in message
...
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.

--
Regards,
Tom Ogilvy

"Ray" wrote in message
...
Can I get some sample VBA code which would import a text file into Excel
2003.

Thanks,
Ray








All times are GMT +1. The time now is 07:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com