+ Reply to Thread
Results 1 to 4 of 4

Thread: How do I detect the cell data change?

  1. #1
    Registered User
    Join Date
    04-27-2005
    Posts
    12

    Question How do I detect the cell data change?

    Hello experts.

    My question is:

    How do I detect the cell data change in order to run a Macro when this happens?

    Example:

    If data in cell D5 changes then run Macro1

    I'm using Excel 2003. Thanks in advance.
    "Strong is who knows his own capacities, but is still stronger who also knows his own weaknesses". Deladier M.

  2. #2
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: How do I detect the cell data change?

    Hi,

    You can try :
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address <> "$D$5" Then Exit Sub
    Call Macro1
    End Sub
    HTH

  3. #3
    Registered User
    Join Date
    04-27-2005
    Posts
    12

    Thanks

    I was trying the code but it did not work for me, and finally with a little change, it worked fine, like this:


    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address(False, False) = "D5" Then
    Macro1
    End If

    End Sub


    Thanks for your help.
    "Strong is who knows his own capacities, but is still stronger who also knows his own weaknesses". Deladier M.

  4. #4
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,770

    Re: How do I detect the cell data change?

    Please edit your post to add cde tags.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0