View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Excel 2007 Macro

In one place you say "5 different workbooks" and then later you say"goes to
.... the separate sheets".

Are we talking about one .xls file with 5 or 6 sheets (tabs) in it, or are
we talking about 6 different .xls files?

If everything is in the same .xls file, then this should work for you, just
change the names of the sheets and "MyMacro" to what they need to be:

Sub DoAllSheets()
Dim startingSheet As String
startingSheet=ActiveSheet.Name
Worksheets("firstSheetName").Activate
Run "MyMacro"
Worksheets("secondSheetName").Activate
Run "MyMacro"
Worksheets("thirdSheetName").Activate
Run "MyMacro"
Worksheets("fourthSheetName").activate
Run "MyMacro"
Worksheeets("AnotherSheetName").Activate
Run "MyMacro"
Worksheets(startingSheet).Activate
End Sub

" wrote:

I have created a macro in 5 separate workbooks that run various tasks
and all update off of a single sheet. I would like to make a macro on
that single sheet that goes to each one of the separate sheets and
starts those macros.

Is there a way to do that?