How to run all macros once only in word document

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • Hi there,


    I have created some macros for setup invoice. but I want to use all macros once only as if by mistake i use more than once all setup changes and unexpected result is coming up. so will you please guide me how to put vba code to run each macros once only.


    Thanks you and Regards,
    Niky

  • Hi Niky,


    There are a couple of ways to achieve this.


    Create a new subroutine and call all the macros from that.


    Or...


    Define a Boolean variable i.e. blnMyMacroRun As Boolean for each macro. Which you set to True at the end of the macro. At the start of the Macro check whether it is True and Exit Sub if it is.



    Regards,


    Tom Rowe

Participate now!

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