dcman98 Posted February 7, 2011 Report Share Posted February 7, 2011 Hello, I regularly receive a CD with a large number of files which must be reorganized into our system. I've been using Macro Express with great success for this, but there is one step which I'd like to automate. The folder structure of the CD is D:\123456 and in that folder there are two files, R54wX.doc and R54qw.xls. There are several hundred folders, and in each, there are these two filenames (though the files themselves have different contents). Each CD provides new random filenames, and I cannot see the reason behind the names. I would like to set a variable by the filename of the .doc file, but how can I get Macro Express to know which file I want? Thank you. Quote Link to comment Share on other sites More sharing options...
paul Posted February 8, 2011 Report Share Posted February 8, 2011 A good start would be to tell us how you decide which file you want. Describe in detail the processes you use to determine your target file. Is it only 1 file you use from the entire CD, or what? Quote Link to comment Share on other sites More sharing options...
dcman98 Posted February 8, 2011 Author Report Share Posted February 8, 2011 A good start would be to tell us how you decide which file you want. Describe in detail the processes you use to determine your target file. Is it only 1 file you use from the entire CD, or what? The way I determine my target files are by the extension. In my example, my macro uses an excel spreadsheet to change the file from D:\123456\R54wX.doc to C:\files from CD\123456_John Smith.doc The folder numbers (i.e. 123456) and client name are part of my spreadsheet, so the macro knows which folder is associated with which client. It then looks at the next line in the spreadsheet, gets the new number and name as variables, and uses the new number in the path to find the file. The difficulty I'm having is that each of the 200+ folders have 2 files in them, one .doc, and one .xls. In each folder, the files have the same name, but I don't know what that name will be, only the extensions. So to run this process, I currently have to browse the CD for the filename, then edit my macro to correct the filename for this CD. I hope that is more clear, and to specifically answer your question, I use 1 file out of each of the 200+ folders, and I know which file I want by the extension. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.