# Solved: Run Macro When Any Data Within a Range of Cells Changes



## Codelicious (Dec 10, 2010)

I am trying to write a VB command that will run a macro when any data is changed within in a particular range of cells upon exiting any of those the cell.

For example in my workbook if someone changes data in any cell in column I in rows 7 through 497 I want my Run2 macro to run. 


Here's what I have.

Private Sub Worksheet_Change(ByVal Target As Range)


If Target.Address = I7:I497 Then

Call Run2

End If

End Sub

I think its as simple as defining the range correctly but I can't find the proper command.


----------



## bomb #21 (Jul 1, 2005)

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("I7:I497")) Is Nothing Then
run2
End If
End Sub


----------



## Codelicious (Dec 10, 2010)

Awesome! Thank you!!!


----------

