Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Execute Macro
Hello,
Is there a way to execute a macro in a formula ?? For example a need to execute a macro if the value in a cell is out of range. Many thanks for your help Yves |
#2
|
|||
|
|||
Hi
not directly, you can however, put worksheet change code against the sheet to read the result of the formula and run appropriate code, e.g. ------ Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" And Target.Value < 4 Then Application.EnableEvents = False Call Macro1 Application.EnableEvents = True End If End Sub ------- if you'ld like help implementing something along these lines, please post back with additional information -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Yves" wrote in message ... Hello, Is there a way to execute a macro in a formula ?? For example a need to execute a macro if the value in a cell is out of range. Many thanks for your help Yves |
#3
|
|||
|
|||
Hi,
Many thanks for your answer, it works very well Regards. Yves "JulieD" a écrit dans le message de news: ... Hi not directly, you can however, put worksheet change code against the sheet to read the result of the formula and run appropriate code, e.g. ------ Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" And Target.Value < 4 Then Application.EnableEvents = False Call Macro1 Application.EnableEvents = True End If End Sub ------- if you'ld like help implementing something along these lines, please post back with additional information -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ...well i'm working on it anyway "Yves" wrote in message ... Hello, Is there a way to execute a macro in a formula ?? For example a need to execute a macro if the value in a cell is out of range. Many thanks for your help Yves |
#4
|
|||
|
|||
you're welcome and thanks for the feedback
"Yves" wrote in message ... Hi, Many thanks for your answer, it works very well Regards. Yves "JulieD" a écrit dans le message de news: ... Hi not directly, you can however, put worksheet change code against the sheet to read the result of the formula and run appropriate code, e.g. ------ Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" And Target.Value < 4 Then Application.EnableEvents = False Call Macro1 Application.EnableEvents = True End If End Sub ------- if you'ld like help implementing something along these lines, please post back with additional information -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ...well i'm working on it anyway "Yves" wrote in message ... Hello, Is there a way to execute a macro in a formula ?? For example a need to execute a macro if the value in a cell is out of range. Many thanks for your help Yves |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Execute Macro automatically after hyperlink | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
Executing macro for all worksheet from a different worksheet | New Users to Excel | |||
Macro and If Statement | Excel Discussion (Misc queries) |