santa12345
Board Regular
- Joined
- Dec 2, 2020
- Messages
- 68
- Office Version
- 365
- Platform
- Windows
Hello. I used to have a VB script that worked with Excel..years ago.
I now have Office 365 and want to do the following.
Loop thru a number of folders and pull particular cells from particular tabs and import them into a master file.
For example .... folder layout is ....
main folder (static name)
c:\source files
main subfolders (static name)
c:\source files\audi
C:\source files\bmw
c:\source files\buick
c:\source files\chevy
under the main subfolders there will be additional sub folders (these folder names will vary as I have 1000's of them)
for this example lets say under the main sub folder audi, there is a car1, car2, and car3 sub subfolder.
sub subfolders
c:\source files\audi\car1
06182024.xls
06192024.xls
c:\source files\audi\car2
c:\source files\audi\car3
within the car1 subfolder and every subfolder, there will be 2 excel files, I want to open up the most recent (date wise) xls file (06182024.xls) and copy ..lets say sheet1.. cell A1 & A2 to a master xls file, sheet1, cell A1&A2.. . Close that file and move to the next sub subfolder. Repeat. Once the last sub subfolder within audi has been copied (car3 subfolder in this case).... move to the main subfolder (bmw)...etc... and keep going.
There will not be any .xls files in the main subfolders (audi, bmw, etc..) only under the sub subfolders.
Hopefully i've outlined this clearly, if not, please let me know.
Thank you for reading and any assistance you can provide would be greatly appreciated.
I now have Office 365 and want to do the following.
Loop thru a number of folders and pull particular cells from particular tabs and import them into a master file.
For example .... folder layout is ....
main folder (static name)
c:\source files
main subfolders (static name)
c:\source files\audi
C:\source files\bmw
c:\source files\buick
c:\source files\chevy
under the main subfolders there will be additional sub folders (these folder names will vary as I have 1000's of them)
for this example lets say under the main sub folder audi, there is a car1, car2, and car3 sub subfolder.
sub subfolders
c:\source files\audi\car1
06182024.xls
06192024.xls
c:\source files\audi\car2
c:\source files\audi\car3
within the car1 subfolder and every subfolder, there will be 2 excel files, I want to open up the most recent (date wise) xls file (06182024.xls) and copy ..lets say sheet1.. cell A1 & A2 to a master xls file, sheet1, cell A1&A2.. . Close that file and move to the next sub subfolder. Repeat. Once the last sub subfolder within audi has been copied (car3 subfolder in this case).... move to the main subfolder (bmw)...etc... and keep going.
There will not be any .xls files in the main subfolders (audi, bmw, etc..) only under the sub subfolders.
Hopefully i've outlined this clearly, if not, please let me know.
Thank you for reading and any assistance you can provide would be greatly appreciated.