Hi All
I have a folder 'ClientsData' that contains over 200 CSV files.
Each file have an average of 21 rows of data. (some more..some less..)
The data seats in column A only.
I have (separate) an Excel file that contains the list of all the files that in 'ClientsData' folder.
The file names are all in "A:A".
I need a macro to check each file in the folder and
store the number of rows that each file have, in Column B.
Any suggestions of how to do that?
Many thanks for your help
Amit
Last edited by furiousfox; 03-17-2010 at 06:59 AM.
Using Excel 2007.
Amit Cohen
Start the macro recorder then Data > Get External Data > From Text and read one csv file.
This creates a QueryTable object with a connection to the CSV file and you can use
to count the number of rows.Code:QueryTable.ResultRange.Rows.Count
Then it's just a matter of looping through each file on the sheet, changing the connection string.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks