Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Run multiple excel files off of one macro.

I have about 5 excel files that I want to run one macro on all five. As soon
as I run the macro on one excel file, it won't work on the next. I have to
close the macro, open it again, then run the macro on the excel spreadsheet,
etc. Is there a way around this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Run multiple excel files off of one macro.

It depends what your macro does and where it is located. I've achieved
this by putting the macro in a "master" file and when I run the macro
it opens file_1, does what it needs to do, saves and closes file_1,
opens file_2, does something else with that then saves and closes it,
and so on. The master file remains unchanged at the end of the
exercise.

Hope this helps.

Pete

ahsya wrote:
I have about 5 excel files that I want to run one macro on all five. As soon
as I run the macro on one excel file, it won't work on the next. I have to
close the macro, open it again, then run the macro on the excel spreadsheet,
etc. Is there a way around this?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Run multiple excel files off of one macro.

Unfortunately my excel files are different each time. Would this make a
difference to what you are describing below?

"Pete_UK" wrote:

It depends what your macro does and where it is located. I've achieved
this by putting the macro in a "master" file and when I run the macro
it opens file_1, does what it needs to do, saves and closes file_1,
opens file_2, does something else with that then saves and closes it,
and so on. The master file remains unchanged at the end of the
exercise.

Hope this helps.

Pete

ahsya wrote:
I have about 5 excel files that I want to run one macro on all five. As soon
as I run the macro on one excel file, it won't work on the next. I have to
close the macro, open it again, then run the macro on the excel spreadsheet,
etc. Is there a way around this?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Run multiple excel files off of one macro.

Again, it depends what you are doing.

In one of the applications where I use the technique outlined earlier,
I have two text files received daily, and these are used to update a
file which is then saved with a date-stamped filename, so it can be
said that these files are always different. I add the filename to a
list in another file, so I know which is the latest file to retrieve
each day (to allow for weekends, holidays etc).

You might like to post your code to the programming group and see what
the response is there (though many of us read all groups).

Hope this helps.

Pete

ahsya wrote:
Unfortunately my excel files are different each time. Would this make a
difference to what you are describing below?

"Pete_UK" wrote:

It depends what your macro does and where it is located. I've achieved
this by putting the macro in a "master" file and when I run the macro
it opens file_1, does what it needs to do, saves and closes file_1,
opens file_2, does something else with that then saves and closes it,
and so on. The master file remains unchanged at the end of the
exercise.

Hope this helps.

Pete

ahsya wrote:
I have about 5 excel files that I want to run one macro on all five. As soon
as I run the macro on one excel file, it won't work on the next. I have to
close the macro, open it again, then run the macro on the excel spreadsheet,
etc. Is there a way around this?




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Run multiple excel files off of one macro.

Does it matter if it is written with a template?

"Pete_UK" wrote:

Again, it depends what you are doing.

In one of the applications where I use the technique outlined earlier,
I have two text files received daily, and these are used to update a
file which is then saved with a date-stamped filename, so it can be
said that these files are always different. I add the filename to a
list in another file, so I know which is the latest file to retrieve
each day (to allow for weekends, holidays etc).

You might like to post your code to the programming group and see what
the response is there (though many of us read all groups).

Hope this helps.

Pete

ahsya wrote:
Unfortunately my excel files are different each time. Would this make a
difference to what you are describing below?

"Pete_UK" wrote:

It depends what your macro does and where it is located. I've achieved
this by putting the macro in a "master" file and when I run the macro
it opens file_1, does what it needs to do, saves and closes file_1,
opens file_2, does something else with that then saves and closes it,
and so on. The master file remains unchanged at the end of the
exercise.

Hope this helps.

Pete

ahsya wrote:
I have about 5 excel files that I want to run one macro on all five. As soon
as I run the macro on one excel file, it won't work on the next. I have to
close the macro, open it again, then run the macro on the excel spreadsheet,
etc. Is there a way around this?






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Run multiple excel files off of one macro.

Unless you post your macro and give more details of the variables and
what it is you want to achieve, you will not be able to get any more
specific advice.

I, for one, do not understand your latest question.

Please give more details !!

Pete

ahsya wrote:
Does it matter if it is written with a template?

"Pete_UK" wrote:

Again, it depends what you are doing.

In one of the applications where I use the technique outlined earlier,
I have two text files received daily, and these are used to update a
file which is then saved with a date-stamped filename, so it can be
said that these files are always different. I add the filename to a
list in another file, so I know which is the latest file to retrieve
each day (to allow for weekends, holidays etc).

You might like to post your code to the programming group and see what
the response is there (though many of us read all groups).

Hope this helps.

Pete

ahsya wrote:
Unfortunately my excel files are different each time. Would this make a
difference to what you are describing below?

"Pete_UK" wrote:

It depends what your macro does and where it is located. I've achieved
this by putting the macro in a "master" file and when I run the macro
it opens file_1, does what it needs to do, saves and closes file_1,
opens file_2, does something else with that then saves and closes it,
and so on. The master file remains unchanged at the end of the
exercise.

Hope this helps.

Pete

ahsya wrote:
I have about 5 excel files that I want to run one macro on all five. As soon
as I run the macro on one excel file, it won't work on the next. I have to
close the macro, open it again, then run the macro on the excel spreadsheet,
etc. Is there a way around this?





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 copy multiple Excel files from Outlook into Excel??? Brainless_in_Boston Excel Discussion (Misc queries) 0 February 24th 06 03:46 PM
how do I join multiple excel files into 1 file? John Excel Discussion (Misc queries) 4 February 22nd 06 07:38 PM
Importing from multiple Excel files Tired of wasting time Excel Discussion (Misc queries) 2 September 21st 05 08:22 PM
Exporting from Excel to multiple XML files Questions Excel Discussion (Misc queries) 0 March 17th 05 10:20 PM
Combine multiple Excel files into one master [email protected] Excel Discussion (Misc queries) 1 November 26th 04 11:20 PM


All times are GMT +1. The time now is 11:28 PM.

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

About Us

"It's about Microsoft Excel"