#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel 2007 Macro

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?
  #3   Report Post  
Posted to microsoft.public.excel.misc
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?

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
macro in excel 2007 Tillie New Users to Excel 1 December 6th 08 06:18 AM
Excel 2007 Macro Help (Excel 2003 not working in 2007) Pman Excel Discussion (Misc queries) 4 May 29th 08 06:29 PM
Excel 2007 - Macro Not Available Angie Excel Discussion (Misc queries) 3 February 7th 08 08:11 PM
Excel 2007 Macro Ken Excel Discussion (Misc queries) 1 December 8th 07 01:31 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM


All times are GMT +1. The time now is 02:17 AM.

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"