ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Found a macro, but don't know how to use it (https://www.excelbanter.com/excel-programming/276791-found-macro-but-dont-know-how-use.html)

lizator

Found a macro, but don't know how to use it
 
I need to import data from a .txt file to Excel - and to an existing
page in Excel. I tried for a bit, but then I realized that Excel
didn't have the feature. I found a good-looking macro on the web at
http://www.cpearson.com/excel/imptext.htm, but I'm not sure how to use
it. Can someone out there give me a hand?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Bob Kilmer

Found a macro, but don't know how to use it
 
Open Excel.

Open a blank workbook.

Open the VBA editor (Alt+F11).

Open or set focus to the Project Explorer (Ctrl+R).

Right-click on the VBProject node on the project tree that corresponds with
the blank workbook. (The module belonging to the active worksheet will
probably be highlighted.)

Select Insert-Module.

Copy the three procedures.
ImportTextFile
DoTheImport
ImportTextLines

Paste the code into the new module.

Save your work.

Return to the worksheet.

Press Alt+F8 (or otherwise open the Macros dialog).

Call DoTheImport or ImportTextLines, according to your preference, from the
Macros dialog.



--
Bob Kilmer


"lizator" wrote in message
...
I need to import data from a .txt file to Excel - and to an existing
page in Excel. I tried for a bit, but then I realized that Excel
didn't have the feature. I found a good-looking macro on the web at
http://www.cpearson.com/excel/imptext.htm, but I'm not sure how to use
it. Can someone out there give me a hand?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/




lizator[_2_]

Found a macro, but don't know how to use it
 
Super! Thanks everyone. I'll try these suggestions. Sounds good.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



All times are GMT +1. The time now is 05:10 AM.

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