Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Run a macro on multiple files in folder

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Run a macro on multiple files in folder

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Run a macro on multiple files in folder

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
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

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
Add Cells Using Multiple Files in One Folder Jeremy Excel Discussion (Misc queries) 2 July 15th 08 04:34 PM
Linking certain cells from Multiple files in a folder onto a summa lee Excel Worksheet Functions 1 June 4th 08 03:19 PM
Extract cell data from multiple files in one folder smonsmo Excel Discussion (Misc queries) 3 August 17th 07 11:16 PM
opening multiple xls files in a folder sc Excel Programming 1 June 30th 06 04:00 PM
"Folder Select" Dialogue - Opening multiple files from selected folder Rob[_26_] Excel Programming 2 September 30th 05 02:47 PM


All times are GMT +1. The time now is 07:29 AM.

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"