Suryaprakash
New Member
- Joined
- Aug 1, 2011
- Messages
- 41
Normally when we record a macro in excel, it is applicable on one file. As such, we are required to run the macro in every file in the folder separately, which is very time consuming. I have 250 to 300 files in a folder with similar structure and I am required to perform various operations on the data, which consumes a lot of time. I would highly appreciate if somebody can tell me how to loop all the files in the folder to perform certain operation on all files (without opening all the files together). We will take a specific example as follows.
Folder path: C:\Folder1\ (contains 250 files of 1 sheet each in Excel 2000)
Opeation to perform: Range("B10:D35").Delete
How can this be done on all files?
I have recorded 4-5 different macros including sorting, conditional formating etc. Can I run any of them by simply putting the name of the macro and if yes, where exactly should the macro name be placed in the code? Putting the whole macro is not desirable as recorded macros are very very lengthy, hence the macro name.
Any help in this respect would be highly appreciated.
Folder path: C:\Folder1\ (contains 250 files of 1 sheet each in Excel 2000)
Opeation to perform: Range("B10:D35").Delete
How can this be done on all files?
I have recorded 4-5 different macros including sorting, conditional formating etc. Can I run any of them by simply putting the name of the macro and if yes, where exactly should the macro name be placed in the code? Putting the whole macro is not desirable as recorded macros are very very lengthy, hence the macro name.
Any help in this respect would be highly appreciated.