I'm fairly new to VBA. I can do some pretty basic commands, but this one is way over my head. Is it possible to loop a filename within an opentxt command? A co-worker is trying to write a code that will open several output.txt files to be used in the next part of his analysis. All the files have the same naming convention shown;
C:\...\path 1.txt
with the number incrementing by 1 each time he makes a run.
Is it possible to use OpenTextFile("C:\path 1.txt") command but use a for loop to increment the path number.
Basically he wants to do something like this
for i = 1 to 10
OpenTextFile("C:\path i.txt")
But I'm not sure if it will work since the increment happens within the text string. Any comments or advice is much appreciated.
Thanks in advance.
Cheers,
Kat
C:\...\path 1.txt
with the number incrementing by 1 each time he makes a run.
Is it possible to use OpenTextFile("C:\path 1.txt") command but use a for loop to increment the path number.
Basically he wants to do something like this
for i = 1 to 10
OpenTextFile("C:\path i.txt")
But I'm not sure if it will work since the increment happens within the text string. Any comments or advice is much appreciated.
Thanks in advance.
Cheers,
Kat