+ Reply to Thread
Results 1 to 2 of 2

Running code when cell contents change

  1. #1
    Registered User
    Join Date
    03-02-2004
    Posts
    4

    Running code when cell contents change

    I have some code which at the moment I run from a button which copies the contents of certain cell to a different location.

    I would like to run this code when the contents of a particular cell change but I also have another three cells and depending on which cell changes a slightly different version of the code needs to be run.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Mark,

    You can test for one or more cells anytime the user selects a cell on the worksheet by placing you code in the Worksheet_SelectionChange procedure for the worksheet you are checking.

    To Test If a certain cell was Selected:
    ________________________________________________________________

    'Cell of interest = $H$30

    If Target.Range.Address = "$H$30" Then

    ...your code routine

    End If
    ________________________________________________________________

    Hope this helps,
    Leith Ross

+ 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.6.0 RC 1