ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatically run a macro when a cell = FALSE (https://www.excelbanter.com/excel-programming/322001-automatically-run-macro-when-cell-%3D-false.html)

Jonathan Neubauer[_2_]

Automatically run a macro when a cell = FALSE
 
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?

Markus Scheible[_2_]

Automatically run a macro when a cell = FALSE
 
Hi Jonathan,


-----Original Message-----
How do you have a macro automatically run when a cell

equals false (until it
becomes true)?


here we a

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



Markus Scheible[_2_]

Automatically run a macro when a cell = FALSE
 
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


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


.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com