Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to List the names of the subfolders present in the folder (path of folder is given in the textbox by user ) divya Excel Programming 3 November 30th 06 11:34 AM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven Excel Discussion (Misc queries) 1 January 24th 06 03:28 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven[_2_] Excel Programming 1 January 24th 06 04:23 AM
Trouble making a report of all Files within a Folder and all Subfolders? SuperJas Excel Programming 2 April 2nd 04 02:41 AM


All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"