Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Can you enter a formula in a cell to run a macro?
Is there a way where I can enter a formula to run a macro? For example could
I enter a formula that say "if this value is greater than or equal to run this macro". |
#2
|
|||
|
|||
A formula cannot run a macro.
Event code behind the worksheet could be used to run a macro when a cell reaches a specific value. Private Sub Worksheet_Calculate() On Error GoTo enditall Application.EnableEvents = False If Range("$B$3").Value = 123 Then ListColorIndexes End If enditall: Application.EnableEvents = True End Sub Right-click on a sheet tab and "View Code" Copy/paste the above in there. Gord Dibben Excel MVP On Mon, 14 Feb 2005 14:51:05 -0800, Nevaeh wrote: Is there a way where I can enter a formula to run a macro? For example could I enter a formula that say "if this value is greater than or equal to run this macro". |
#3
|
|||
|
|||
Jeez.........having a bad day.
"ListColorIndexes" will of course be adjusted to your macroname. Gord On Mon, 14 Feb 2005 15:26:29 -0800, Gord Dibben <gorddibbATshawDOTca wrote: A formula cannot run a macro. Event code behind the worksheet could be used to run a macro when a cell reaches a specific value. Private Sub Worksheet_Calculate() On Error GoTo enditall Application.EnableEvents = False If Range("$B$3").Value = 123 Then ListColorIndexes End If enditall: Application.EnableEvents = True End Sub Right-click on a sheet tab and "View Code" Copy/paste the above in there. Gord Dibben Excel MVP On Mon, 14 Feb 2005 14:51:05 -0800, Nevaeh wrote: Is there a way where I can enter a formula to run a macro? For example could I enter a formula that say "if this value is greater than or equal to run this macro". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to return cell contents based on multiple conditions | Excel Worksheet Functions | |||
Cell shows formula and not the result of the formula. | Excel Worksheet Functions | |||
I want the results of a formula to show in cell, NOT THE FORMULA! | Excel Discussion (Misc queries) | |||
Formula window displays correct answer while cell displays incorre | Excel Worksheet Functions | |||
Can you enter a formula in a cell that auto-inputs calculations a. | Excel Worksheet Functions |