Thanks for the reply. I want the macro to count the number of lines in the text file and update the count in the excel file. I have several text files to be checked in different paths. paths are in the sheet 1 column A. I want the count to be updated in column B. Please help me . Thanks!