Applying a macro to all the macros in a book without having to state it or call it in each macro

Posted on 2012-08-27
Last Modified: 2012-08-27
In my specific situation at the moment, I want to call this macro at the beginning of every macro. Every macro but 'this' macro itself:  
Sub LogMacro()
Set mLog = [MacroLog].End(xlDown).Offset(1, 0)
Set mLogBtm = mLog.Offset(0, 1).End(xlDown).Offset(0, -1)
mLog = "ü"
End Sub

Open in new window

Is there a way to do that?

Question by:gabrielPennyback
    LVL 1

    Author Comment

    I forgot to add that some of the macros are initiating when an external workbook is the active workbook.
    LVL 18

    Accepted Solution

    I don't believe there is a way to do this without using call.

    You could however create a user form and have that run the above macro when it loads, then use buttons on the form to run the other macros.
    LVL 1

    Author Closing Comment

    That's kind of what I figured. Thanks, at least, for confirming my suspicions!

    - John
    LVL 18

    Expert Comment

    No worries. Hope you get something sorted without too much effort.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now