View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
mr tom mr tom is offline
external usenet poster
 
Posts: 119
Default Run a macro on multiple files in folder

Hi Alan,

I'm also learning at present and am trying to solve a similar problem.

I'd suggest:

1 Record a macro to add the desired footer to your current workbook.
2 Search these forums for "run code on all files in folder" - there are a
few likely looking entries where people have come up with the core code and
left in comments saying "insert what you want to do here".
3 Insert the code generated by your first macro at the appropriate point in
your second.

Sorry this isn't more specific - I've still got lots to learn, but the
answers are definately out there and recording a macro will allow you to
customise this to your own needs.

Hope this helps.

Tom.

"Alan" wrote:

I've only written one macro as an experiment so my familiarity with the terms
is limited. More specefic instructions would be helpful. Thanks.

"Madhan" wrote:

Hi, you need to follow the given algorithm and write VBA code to fulfil your
task.
1. Initialise a FileSystem object
2. Get the number of files from the given directory
3. Within a loop (until the number of files is exhausted) do the following
3.1. Load the next file
3.2. Add footer with current date to the file

"Alan" wrote:

I have a folder that has about 100 diffrent excel files in it. I'd like to
run a macro which will add a footer with the current date on all of these. I
can do this on one by hand but if I'd like to get them all in one fell
swoop. Thanks in advance.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...el.programming