Try:
Another thing is, the way you are referencing the worksheet is very inconsistent, you have:![]()
Worksheets("Sheet 1").Range(Cells(erow, 1), Worksheets("Sheet 1").Cells(Rows.Count, 2).End(xlUp).Offset(, -1)).Value = strFile
Worksheets(1)
Sheet1
Worksheets("Sheet 1")
Not that it is a problem now, but may cause error if your worksheet is no longer named "Sheet 1".
Bookmarks