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

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Codelicious

Thread Starter
Joined
Dec 10, 2010
Messages
5
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.
 
Joined
Jul 1, 2005
Messages
8,546
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("I7:I497")) Is Nothing Then
run2
End If
End Sub
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top