Hi again,
The statement:
must be inserted in EACH of the user-defined functions which you wish to prevent from calculating while the MyMacro routine is executing.
The variable bMacroRunning is defined as a module-level variable (i.e. at the top of the Code Window) - this means that it is available to all routines contained in the module.
As soon as the MyMacro routine is executed, the bMacroRunning variable is set to TRUE. Whenever your user-defined functions are called (from the worksheet), the above If statement causes control to exit immediately from the user-defined function.
When the MyMacro routine has executed, the bMacroRunning variable is set to FALSE - this means that user-defined functions will be calculated, as the result of the above If statement will be FALSE.
Hope this helps - please let me know how you get on.
Regards,
Greg M
Bookmarks