Is it possible to enter a formula into a cell, and if the result returns True
then a macro runs? The Formula may look like this
=If(Logical_Test,[Call”MacroName”],[Value_if_False])
Can it be done if the result returns False?
Is it possible to enter a formula into a cell, and if the result returns True
then a macro runs? The Formula may look like this
=If(Logical_Test,[Call”MacroName”],[Value_if_False])
Can it be done if the result returns False?
No
For formulas/functions no activities are allowed - they only can display
information in cell, they are situated.
--
When sending mail, use address arvil<at>tarkon.ee
Arvi Laanemets
"PraxisPete" <[email protected]> wrote in message
news:[email protected]...
> Is it possible to enter a formula into a cell, and if the result returns
True
> then a macro runs? The Formula may look like this
>
> =If(Logical_Test,[CallMacroName],[Value_if_False])
>
> Can it be done if the result returns False?
>
Arvi is correct, you cant activate a macro directly from a formula. What you can do however is, on the Worksheet_Calculate() event, have a macro that:-
Of course this macro will run again and again while ever your criteria is being met, unless you code it to only run once, or even only once each criteria.If range("A1") = [whatever] then ... run macro End If
eg.
A1 = 0, criteria not met, macro not run
A1 = 1, criteria met, macro run
A1 = 1, still met but already run so this time, not run
A1 = 0 criteria not met, macro not run, macro reset
A1 = 1, criteria met for first time after being reset, macro run
... etc
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks