Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to copy multiple Excel files from Outlook into Excel??? | Excel Discussion (Misc queries) | |||
how do I join multiple excel files into 1 file? | Excel Discussion (Misc queries) | |||
Importing from multiple Excel files | Excel Discussion (Misc queries) | |||
Exporting from Excel to multiple XML files | Excel Discussion (Misc queries) | |||
Combine multiple Excel files into one master | Excel Discussion (Misc queries) |