G Guest Dec 13, 2004 #1 Is it possible to disable a macro and prevent it from running with a command from another macro?
J Jim Rech Dec 13, 2004 #2 One way to do that is with a flag variable: Dim DisableFlag As Boolean Sub DisableTheMacro() DisableFlag = True End Sub Sub EnableTheMacro() DisableFlag = False End Sub Sub TheMacro() If Not DisableFlag Then MsgBox "The Macro has Run!" End If End Sub -- Jim Rech Excel MVP | Is it possible to disable a macro and prevent it from running with a command | from another macro? | -- | Andy T
One way to do that is with a flag variable: Dim DisableFlag As Boolean Sub DisableTheMacro() DisableFlag = True End Sub Sub EnableTheMacro() DisableFlag = False End Sub Sub TheMacro() If Not DisableFlag Then MsgBox "The Macro has Run!" End If End Sub -- Jim Rech Excel MVP | Is it possible to disable a macro and prevent it from running with a command | from another macro? | -- | Andy T