![]() |
opening consecutive files
Hi,
I've been trying to figure this out all weekend, but I'm kinda stuck. I would like to open some text files in excel, copy some info into another worksheet, then open another text file. But I have to be order specific. So the first file is plate1.txt, then open plate2.txt, and so on. Any advice would be greatly appreciated, jon |
opening consecutive files
dim iCtr as long
dim myFileName as string for ictr = 1 to 10 'whatever??? myfilename = "C:\my documents\excel\plate" & ictr & ".txt" 'your code to open and process and close next ictr Jay Noname wrote: Hi, I've been trying to figure this out all weekend, but I'm kinda stuck. I would like to open some text files in excel, copy some info into another worksheet, then open another text file. But I have to be order specific. So the first file is plate1.txt, then open plate2.txt, and so on. Any advice would be greatly appreciated, jon -- Dave Peterson |
opening consecutive files
you can do this in a loop
eg (untested) dim x as integer dim sDir as string sDir="C:\datafiles\" x=1 do while dir(sDir & "plate" & x & ".txt") <"" 'process file here x=x+1 loop Tim "Jay Noname" wrote in message ups.com... Hi, I've been trying to figure this out all weekend, but I'm kinda stuck. I would like to open some text files in excel, copy some info into another worksheet, then open another text file. But I have to be order specific. So the first file is plate1.txt, then open plate2.txt, and so on. Any advice would be greatly appreciated, jon |
opening consecutive files
thanks for the advice,
I'll give them a go this morning and let you know how it works out jon |
All times are GMT +1. The time now is 12:37 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com