ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how can i run a macro from a formula (https://www.excelbanter.com/excel-programming/398530-how-can-i-run-macro-formula.html)

Fred

how can i run a macro from a formula
 
i CREATED A VERY SIMPLE MACRO TO DELETE ROWS, BUT I WANT TO CALL IT WHEN
CERTAIN CONDITIONS ARE TRUE, IT IS POSSIBLE CALL A MACRO FROM A FORMULA? I
THINK THAT IN LOTUS 123 THERE IS A COMMAND TO EXECUTE A MACRO SO SHOULD BE
ONE IN EXCEL.

THANKS

JRForm

how can i run a macro from a formula
 
Fred,

Try this =<Function Name(D10,"=1000")
Make your macro a function and place it in the formula in place of the
<Function Name.

"FRED" wrote:

i CREATED A VERY SIMPLE MACRO TO DELETE ROWS, BUT I WANT TO CALL IT WHEN
CERTAIN CONDITIONS ARE TRUE, IT IS POSSIBLE CALL A MACRO FROM A FORMULA? I
THINK THAT IN LOTUS 123 THERE IS A COMMAND TO EXECUTE A MACRO SO SHOULD BE
ONE IN EXCEL.

THANKS


Jim Thomlinson

how can i run a macro from a formula
 
What JRForm is talking about is a user defiend function (or UDF) which can
only return a value to the cell that it is in. It can not delete other cells
or rows or change formating or... It can ONLY return a value. So I don't
think that is going to work out for you. A better option would probably be
event programming. After the user has enetered a value (the event) code will
automatically be executed to check the conditions and take the appropriate
actions. Here is a link to get you started...

http://www.cpearson.com/excel/Events.aspx
--
HTH...

Jim Thomlinson


"JRForm" wrote:

Fred,

Try this =<Function Name(D10,"=1000")
Make your macro a function and place it in the formula in place of the
<Function Name.

"FRED" wrote:

i CREATED A VERY SIMPLE MACRO TO DELETE ROWS, BUT I WANT TO CALL IT WHEN
CERTAIN CONDITIONS ARE TRUE, IT IS POSSIBLE CALL A MACRO FROM A FORMULA? I
THINK THAT IN LOTUS 123 THERE IS A COMMAND TO EXECUTE A MACRO SO SHOULD BE
ONE IN EXCEL.

THANKS



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

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