ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run a Macro inside a formula (https://www.excelbanter.com/excel-discussion-misc-queries/191019-run-macro-inside-formula.html)

crash20001

Run a Macro inside a formula
 
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

Gary''s Student

Run a Macro inside a formula
 
You can use a worksheet event macro to run when the result of a cell's
calculation meets a criteria. See:


http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200791


"crash20001" wrote:

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


Harald Staff[_2_]

Run a Macro inside a formula
 
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

"crash20001" wrote in message
...
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



crash20001

Run a Macro inside a formula
 
I am having issues with the event marco location. Is it in the VB code or in
Excel?

"Harald Staff" wrote:

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

"crash20001" wrote in message
...
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




Otto Moehrbach[_2_]

Run a Macro inside a formula
 
It is VBA code and all VBA code is a part of the file in which it resides.
HTH Otto
"crash20001" wrote in message
...
I am having issues with the event marco location. Is it in the VB code or
in
Excel?

"Harald Staff" wrote:

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

"crash20001" wrote in message
...
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






Harald Staff[_2_]

Run a Macro inside a formula
 
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


"crash20001" wrote in message
...
I am having issues with the event marco location. Is it in the VB code or
in
Excel?

"Harald Staff" wrote:

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

"crash20001" wrote in message
...
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






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

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