MatthewBell
Technical User
Hi there, it's a long time since I last posted on here, I hope the forum's still as good as it used to be.
I have a load of test data files with a standard file name format. "baXXc*.DFT" and I have to copy some data from each to an excel workbook.
XX is a number that increases with each test and there are three files from each XX number/test.
* is a number 1-3 (there are 3 channels of data incase your wondering).
I need to open the files in the order
ba01c1.DFT
ba02c1.DFT
ba03c1.DFT
ba04c1.DFT
ba05c1.DFT etc etc
until the last XX number and copy 2cols of data from each onto a sheet (I have code to get a DFT to open in excel and perform the copy). I need the loop to paste the data in the next two clear cols in the sheet so I'll need code for this.
I then want to do the same for all the baXXc2 and c3 files putting them on 2 other sheets.
All the files are in a single folder.
Can anyone give me some loops, into which I can put my copy code, that will open the files in the correct order (all XX numbers for c1 then all for c2 etc) and also ensure the 2cols I copy go into the next two clear cols in the sheet.
Many thanks for reading, any help would be appreciated.
Matt![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)
I have a load of test data files with a standard file name format. "baXXc*.DFT" and I have to copy some data from each to an excel workbook.
XX is a number that increases with each test and there are three files from each XX number/test.
* is a number 1-3 (there are 3 channels of data incase your wondering).
I need to open the files in the order
ba01c1.DFT
ba02c1.DFT
ba03c1.DFT
ba04c1.DFT
ba05c1.DFT etc etc
until the last XX number and copy 2cols of data from each onto a sheet (I have code to get a DFT to open in excel and perform the copy). I need the loop to paste the data in the next two clear cols in the sheet so I'll need code for this.
I then want to do the same for all the baXXc2 and c3 files putting them on 2 other sheets.
All the files are in a single folder.
Can anyone give me some loops, into which I can put my copy code, that will open the files in the correct order (all XX numbers for c1 then all for c2 etc) and also ensure the 2cols I copy go into the next two clear cols in the sheet.
Many thanks for reading, any help would be appreciated.
Matt
![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)