View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John V[_3_] John V[_3_] is offline
external usenet poster
 
Posts: 2
Default Consolidating tab-delimited text files

I am in the business of consolidating about 60 text files onto one worksheet as follows:
1. Opening a tab-delimited text file in the same folder as ThisWorkbook.
2. Parsing the file a la OpenText
3. Copying all non-empty cells
4. Opening the master workbook
5. Finding the bottom of the worksheet
6. Pasting the cells
7. Repeat for as many txt files as there are in a particular folder. (The files are surveys, with identical numbers of columns but varying numbers of rows.)

Questions:
1. For step 3, would accessing the cells this way (Worksheets("Sheet1").Cells) be workable, or is there a way to easily grab just the non-empty cells? Does it really matter?
2. For step 4, my simple mind would scan down column A looking for the first empty cell. Is there a more efficient way?
3. I'd like to generalize the routine to search only for those txt files in the same folder as ThisWorkbook. I saw a simple line of code that does that here, but now it has escaped me.

Thanks for any help, John