Share via

How to combine several Word macros into one action?

Anonymous
2011-09-27T00:58:35+00:00

I have several smaller macros that I want to invoke in succession. I realize that I can use comments and string them all together into one long block, but I want to keep them all separate for reasons no one would find interesting. I used to know how to do this, but I can't remember. If anyone else knows how to do create one Macro 001, which triggers Macro A, Macro B, and Macro C, I'd love some help here. Thanks.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2012-02-10T23:22:11+00:00

    This must be achievable in the Word GUI for my project. I got my answer offline. It's simply listing the child macros by name from within a parent macro:

    Sub parentmacro()

    '

    ' Run all child macros.

    '

        child1

        child2

        child3

    End Sub

    Thanks to everyone for weighing in. My needs are resolved.

    2 people found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-02-10T22:47:37+00:00

    Using Call to Run VBA Macros

    http://word.tips.net/T000086_Using_Call_to_Run_VBA_Macros.html

    Summary: An elegant way to run macros from within macros is to use the Call statement. In order to use it, you need to provide a reference from the calling project to the one being called. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)

    0 comments No comments
  2. Anonymous
    2012-02-10T22:12:01+00:00

    Thanks for the answer so far. I am looking specifically for the magic code to call macros from within a macro within Word. (I used to know how to do this but I lost the code.) Specifically, I want a tidy code stack that calls the gnarlier macros one by one. Calling /sub/ by /sub/ will allow me to better swap in and out the macros I want to include/exclude. Thanks

    0 comments No comments
  3. Anonymous
    2011-09-27T02:50:01+00:00

    You  could simply record a macro that runs all of the others.

    Open your Developer tab and choose Record Macro. Then, assuming all of the other macros are already loaded into your Normal.dtom template, one by one choose the Macros button on the Developer tab, select the macro and click Run. When you're done you'll have a new recorded macro that executes all of the others in succession.

    Hope this helps

    0 comments No comments