+ Reply to Thread
Results 1 to 5 of 5

Run all Macros

  1. #1
    Registered User
    Join Date
    08-14-2007
    Posts
    27

    Run all Macros

    Hey Guys,

    I need a code that will run all the macros in my workbook except 3 specific ones. Unfortunately, the traditional way of listing them in the below fashion is not what im looking for:

    Sub Master()
    Run ["ThisWorkbook.Email1"]
    Run ["ThisWorkbook.Email2"]
    Run ["ThisWorkbook.Email3"]
    Run ["ThisWorkbook.Email4"]
    Run ["ThisWorkbook.Email5"]
    Run ["ThisWorkbook.Email6"]

    Does anyone have a "run-all-macros" code that will simply run everything without having to list each macro out? Secondly, can you exclude three specific macros to prevent them from running?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Weathistime,

    The only way to run all the macros, or at least the ones you want is to create another macro that calls the macros you want to run. There is no built-in "Run All Macros".

    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    07-05-2007
    Location
    Lexington, MA
    Posts
    302
    What are the macros doing?
    Why do you want to run them all except 3?
    FrankBoston is the pen name for Andrew Garland, Lexington MA

  4. #4
    Registered User
    Join Date
    08-14-2007
    Posts
    27
    Frank,

    Essentially I have 250 + 3 macros in a workbook. Each of the 250 macros corresponds to a worksheet and an employee. Each macro exports the worksheet into its own workbook, opens up a lotus notes email, attaches that workbook, and sends out the email automatically.

    Naturally, we hire alot of new employees, and employees also terminate. When an employee terminates I can delete their worksheet and their macro- easy enough. However, whenever this happens, I have to go into the subroutine that runs all the macros and manually edit the list of macros to run (to remove that employee's macro from the list even though the macro has already been deleted). This is not a huge deal, but right now I am trying to find ways to make this simpler and more user friendly for someone with limited Excel experince.

    I could avoid this if there were a way to run all the macros in the workbook (except the other 3)- without having to specifically input the names of the macros to run. However, according to Leith this is not possible- so no big deal Thanks guys for your expertise.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Wealthistime,

    Now that you have given a more details about your needs, I would have to say "Yes, it is doable". If you can post an abbreviated workbook (a few sample sheets + the 3 macros) I will be happy to take a look, and write any code you may need.

    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1