Automatically run a macro when a cell = FALSE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you have a macro automatically run when a cell equals false (until it
becomes true)?
Obviously there are other issues like a neverending loop etc. but besides
error-trapping, how could I get this to work?
 
Hi Jonathan,

-----Original Message-----
How do you have a macro automatically run when a cell equals false (until it
becomes true)?

here we are:

if isError(workbooks("abcd.xls").sheets("abcd").range
("cell").value) = true then
do
' your Macro
loop
end if

Maybe use if workbooks("abcd.xls").sheets("abcd").range
("cell").value = "false" instead if in the cell the
word "false" is produced... use the code before if the
cell shows an error...
Obviously there are other issues like a neverending loop etc. but besides
error-trapping, how could I get this to work?
.

Be aware of that problem... neverending loops are mean if
users don't know how to interrupt them...

Best

Markus
 
Once again,

if isError(workbooks("abcd.xls").sheets("abcd").range
("cell").value) = true then
do
' your Macro
loop
end if


that was not correct, because the do loop should be
outside the if... otherwise it would be a neverending loop
for sure... however, here it follows:

do until isError(workbooks("abcd.xls").sheets("abcd").range
("cell").value) = false

' your Macro

loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top