MrExcel Publishing
Your One Stop for Excel Tips & Solutions

macros and formulae

Posted by Steve on November 13, 2001 6:18 AM

Can a macro be run from within a formula - eg as part of an IF statement?

Posted by Juan Pablo on November 13, 2001 7:11 AM

Not *directly* as in


but you could use the
events to do what you're looking for... i.e.

If Range("A1") = 1 then
End If

Juan Pablo

Posted by Rick E on November 13, 2001 7:34 AM

You can define a Function which can have all kinds of code in it, even MsgBox displays, etc. but that cell will only be able to have the output of that function.