hi,
i am trying to loop through all files in a folder (each file being labelled MyFile), copy a chunk of stuff from each MyFile, paste that onto another file ("main.xlsx"), then copy a cell from MyFile to rename the particular worksheet in main.xlsx. i have found a useful chunk of code to loop through all files in a folder at http://mariaevert.dk/vba/?p=99, and have modified it slightly, to get:
there are 2 errors in this code that i do not know how to correct:![]()
Please Login or Register to view this content.
1. Windows(MyFile).Activate
can someone pls show me how to activate MyFile again within the loop?
2. Sheets("Sheet" & i).Name = C4
i would like to rename the activesheet in main.xlsx to the text that is in C4 in MyFile; how do i do that?
thanks for any help!
Bookmarks