Execute Macro

Y

Yves

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
 
J

JulieD

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
 
Top