automatically execute an Excel macro on a cell change

Posted by namin on Stack Overflow See other posts from Stack Overflow or by namin
Published on 2009-01-03T17:33:22Z Indexed on 2010/04/20 17:23 UTC
Read the original article Hit count: 282

Filed under:
|
|
|
|

How can I automatically execute an Excel macro each time a value in a particular cell changes?

Right now, my working code is:

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("H5")) Is Nothing Then Macro
End Sub

where "H5" is the particular cell being monitored and Macro is the name of the macro.

Is there a better way?

© Stack Overflow or respective owner

Related posts about excel

Related posts about vba