Run a Macro inside a formula

C

crash20001

I would like to know if it possible to run a marco inside a formula. I am
looking to put a formula together that uses a "If" statement, that if true it
would run a marco?

Thanks
 
H

Harald Staff

Formulas can not run macros, it's a limitation by design. You might instead
have a look at the worksheet_change event macros in the sheet module or
thisworkbook module, they run on cell entries.

HTH. Best wishes Harald
 
C

crash20001

I am having issues with the event marco location. Is it in the VB code or in
Excel?
 
O

Otto Moehrbach

It is VBA code and all VBA code is a part of the file in which it resides.
HTH Otto
 
H

Harald Staff

Rightclick the sheet tab, "view code", and you should be able to create it
with the two dropdowns just above the big white module area.

And then ThisWorkbook is found in the project explorer to the left.

Best wishes Harald
 
Top