Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Making a sub run in a particular folder
Say I have the following path to a folder "Centers": X:\...\...\...\Centers Within the Centers folder I have 10 folders, each named a particular city: X:\...\...\...\Centers\LA X:\...\...\...\Centers\NY X:\...\...\...\Centers\San Diego etc In each of the city folders are Weekly Excel reports. I'm writing a program that will look in each city folder and pull out only a specified month. I don't know how to tell the code to go to each of the city folders and execute. How do write that? This is what I'm trying to do explained a different way: I have a spreadsheet with a dropdown and a button, "Compile". I select "March" from my dropdown and click Compile. My code should go to X:\...\...\...\Centers\LA, pull out all spreadsheets with "March" in the filename, execute whatever code I specify, and dump it into another sheet in the workbook called LA. Once LA is done the code should continue to the next city folder and do the same thing until the code runs through all the city folders. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Making a sub run in a particular folder
You want a batch processing macro. look at this example: http://www.rondebruin.nl/copy4.htm Go to the section named 'Change cells or range in one or all worksheets in each file'. Replace the red code with code that does what you need done. Post back if you have any additional questions. HTH, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Bishop" wrote: Say I have the following path to a folder "Centers": X:\...\...\...\Centers Within the Centers folder I have 10 folders, each named a particular city: X:\...\...\...\Centers\LA X:\...\...\...\Centers\NY X:\...\...\...\Centers\San Diego etc In each of the city folders are Weekly Excel reports. I'm writing a program that will look in each city folder and pull out only a specified month. I don't know how to tell the code to go to each of the city folders and execute. How do write that? This is what I'm trying to do explained a different way: I have a spreadsheet with a dropdown and a button, "Compile". I select "March" from my dropdown and click Compile. My code should go to X:\...\...\...\Centers\LA, pull out all spreadsheets with "March" in the filename, execute whatever code I specify, and dump it into another sheet in the workbook called LA. Once LA is done the code should continue to the next city folder and do the same thing until the code runs through all the city folders. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to List the names of the subfolders present in the folder (path of folder is given in the textbox by user ) | Excel Programming | |||
Save file in a new folder, but create folder only if folder doesn't already exist? | Excel Programming | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Programming | |||
Trouble making a report of all Files within a Folder and all Subfolders? | Excel Programming |