1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

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

Discussion in 'Business Applications' started by Codelicious, Dec 21, 2010.

Thread Status:
Not open for further replies.
  1. Codelicious

    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.
     
  2. bomb #21

    bomb #21

    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
     
  3. Codelicious

    Codelicious Thread Starter

    Joined:
    Dec 10, 2010
    Messages:
    5
    Awesome! Thank you!!!
     
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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/969854

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice