Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.worksheet.functions
external usenet poster
 
Posts: 3,290
Default Run multiple excel files off of one macro.

Sub WontWork
Workbooks.Open FileOne
Call RunCode(FileOne)
Workbooks. Close FileOne SaveChanges:=True

Workbooks.Open FileTwo
Call RunCode(FileTwo)
Workbooks.Close FileTwo SaveChanges:=True

'more of the same
End Sub

Function RunCode (ByRef objWorkBk as Excel.Workbook)
'Code to do stuff to objWorkBk
End Function



"ahsya"
wrote in message
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
Import multiple text files (Macro) Thr33of4 Excel Discussion (Misc queries) 0 September 19th 06 02:19 AM
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
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 04:48 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"