Run Macro From Within an =IF statement

J

job1job1

Is there a command that I can use within an =IF( statement to run
macro?

For example:

=IF(C2="Y",run=macroname,"N")

Thanks
 
H

Harlan Grove

Is there a command that I can use within an =IF( statement to run a
macro?
...

No. Closest you can get is Calculate and SheetCalculate event handlers.
 
M

Marcotte A

Frank
If you changed the macro from a Sub to a Function wouldn't it work (without it being an event procedure)?
 
F

Frank Kabel

Hi
depends on what this macro should do. If it should only return a value,
no problem but if it should change formats or other cells, no chance!
 
Top