Microsoft Excel Webinar

Results 1 to 4 of 4

Thread: Running Multiple Macros from a command button

  1. #1

    Unhappy Running Multiple Macros from a command button

    Hi
    I have a command button and a whole bunch of macros. Rather than having one button for each macro I'd like to have just one button for all the macros.

    I've tried putting multiple "Run" commands into the On-click event e.g
    Run ("Macro1")
    Run ("Macro2")
    Run ("Macro3")
    but only the first run command executes.

    Can anyone suggest any way around this.

    Many Thanks
    J

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,633
    Location
    Blog Entries
    1
    Well in the on click event you can call or run as many macros as you want.

    VB:
    Call macro1 
    Call macro2 
    
    
    Formatting tags added by mark007
    Or
    VB:
    Application.Run "Macro1" 
    Application.Run "Macro2" 
    
    
    Formatting tags added by mark007

  3. #3
    OR you can create a driver macro that contains a call to each of the other macros:
    Sub CallMacs()
    Call Macro1
    Call Macro2
    ...
    End Sub
    which is essentially what DRJ just suggested.

  4. #4
    What macros do you wish to run please post them

Posting Permissions

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