combining macros

  • I have 8 separate macros that run verywell individually. Is there a way I can make a macro that will call these individual macro's in some sequential order? I now have 8 individual buttons that I press separately which save hours of time and I would like to make them all combine under one button.
    I was trying to put code in a module that would call the individual macros but have failed. any ideas would be a bonus.

    Thanks Billyj

  • Re: combining macros

    Try this

    Private Sub CommandButton1_Click()
    run: macro1
    run: macro2
    run: macro3
    'etc etc
    End Sub

    Hope that helps

    Matt B

  • Re: combining macros

    If you want a macro in a general module that you can call, the following syntax also will work for macros named "Inventory" and "CountIt" and "SortData"

    Sub CallMyMacros()
      Call Inventory
      Call CountIt
      Call SortData
    End Sub
  • Re: combining macros

    I could not get the call macros to work but I got it to work this way:is it because sove of my macros were private versus public Subroutines? Sorks well but sure clean and neat.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!