View Single Post
  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

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
"Andy T" wrote in message
...
| Is it possible to disable a macro and prevent it from running with a
command
| from another macro?
| --
| Andy T