This is strange.
You start with initial value i = 35
and for the first found file :
the value of i is increased by one, so now i = 36
But from your post, you say i = 37, I really don't know how.
Now processing file : 6.txt
File : 6.txt , i = 37, L36 = 07
Just curious, how if you delete this line (all the line, including trailing spaces) :
and then retype it manually by hand (not by copy paste).
Also, do you have event code ? (Worksheet_Change, etc)
And how do you call this sub, from a button, or launch from other sub ?
Originally Posted by
rizmomin
How about i change Do while File_To_Open <> "" to 1 to 11 as i have 11 files in the folder.
No, that is unwise, if the number of found files is less than 11, it will produce error, the current code is already good.
Bookmarks