Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andy T
 
Posts: n/a
Default Disable one Macro with another Macro

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable menu selection andy Excel Discussion (Misc queries) 3 December 10th 04 10:46 PM
excel macro inconsistency JM Excel Discussion (Misc queries) 2 December 9th 04 01:13 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro help Jeff Garrett Excel Discussion (Misc queries) 11 December 1st 04 08:47 PM
macro interruption: help!!! mario milani Excel Discussion (Misc queries) 1 November 30th 04 06:02 PM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"