Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Multiple Text files into one worksheet-need help

I have multiple text files that I want to load into a microsoft excel
spread sheet. Here is how it goes, I have four folders each contains
about 20 data sets. I will have more, is there any way I can write a
macro to load these text files starting at row 19 into one worksheet.
Each data set contains two columns and about 250 rows. The file names
in a folder go up by experiment and number so it goes emi1.txt,
emi2.txt....then emi(2)1.txt, emi(2)2.txt and so on and so forth. If I
can even load one folder at a time that would be great, I tried
recording a macro but I would have to copy and paste and change the
file name and target cell over 60 times. Is there anyway I can do this
easily, and if possible have the filename be located on the first row?

Thanks
Bob

  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Multiple Text files into one worksheet-need help

You might take a look at Jim Cone's free Add-in called ListFiles......it
won't do the whole job for you, but it might make it a lot easier......

Available at http://www.realezsites.com/bus/primi.../products.php?

Vaya con Dios,
Chuck, CABGx3



wrote in message
oups.com...
I have multiple text files that I want to load into a microsoft excel
spread sheet. Here is how it goes, I have four folders each contains
about 20 data sets. I will have more, is there any way I can write a
macro to load these text files starting at row 19 into one worksheet.
Each data set contains two columns and about 250 rows. The file names
in a folder go up by experiment and number so it goes emi1.txt,
emi2.txt....then emi(2)1.txt, emi(2)2.txt and so on and so forth. If I
can even load one folder at a time that would be great, I tried
recording a macro but I would have to copy and paste and change the
file name and target cell over 60 times. Is there anyway I can do this
easily, and if possible have the filename be located on the first row?

Thanks
Bob



  #3   Report Post  
Posted to microsoft.public.excel.misc
yanks6rule
 
Posts: n/a
Default Multiple Text files into one worksheet-need help

In another forum I found this macro and I don't know if it will work
for what I want to do but I thought someone who has a little more
expertise might know.

Thanks

Sub opentext()

Dim i As Integer


For i = 1 To 10000

Workbooks.opentext Filename:="D:\VB\10000" & i & ".out", _ /The text
file can be name as 10001, 10002,....
Origin:=xlMSDOS, _
StartRow:=1, _
DataType:=xlDelimited, _
ConsecutiveDelimiter:=True, _
Space:=True

Next i

End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change number to text in new column from another worksheet? Lynn Excel Worksheet Functions 3 November 16th 05 12:45 PM
Comparing a list to a Calendar worksheet. PatrickL Excel Worksheet Functions 0 August 25th 05 04:21 PM
Converting multiple worksheet to a single page worksheet [email protected] Excel Discussion (Misc queries) 0 July 4th 05 06:26 PM
extract text from html files Glowinafuse Excel Discussion (Misc queries) 3 May 31st 05 06:23 AM
Importing multiple Text files into Excel 2003 JMA Excel Discussion (Misc queries) 5 May 5th 05 09:48 PM


All times are GMT +1. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"