ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Consolidating tab-delimited text files (https://www.excelbanter.com/excel-programming/306177-consolidating-tab-delimited-text-files.html)

John V[_3_]

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


All times are GMT +1. The time now is 04:00 AM.

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