Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write macro to import many .txt files?

Status
Not open for further replies.

kre1973

IS-IT--Management
May 5, 2006
47
US
I have a folder that contains many .txt files that I need to import into Excel. Every .txt file would have it's own indivdual sheet based on the name of the text file.

With every .txt file there are records within it that would put imported into rows which are delimited by the pipe symbol "|" starting in row 2.


thanks
 




hi,

Have you turned on your macro recorder, and recorded doing a Data > Import External Data > Import?

You can specify the pipe as a delimiter and the starting row.

Post back with your recorded code if you need further help.

Skip,
[sub]
[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue][/sub]
 
I actually want ot use Excel VBA code...
 
In case you're looking for it, Tools > Macro > Record New Macro

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top