Is there a way to disable a macro based on the value of a cell?

J

Jeff

Is there a way to disable (or turn off) a particular macro based on the value
of a cell?
 
D

Dave Peterson

Probably not. But you could put a check in the macro to see if it should
continue:

Option Explicit
Sub testme()
dim myValToCheck as variant

myvaltocheck = activesheet.range("a1").value

if ucase(myvaltocheck) = ucase("Stop") then
exit sub
end if

'real code here
End Sub
 
Top