+ Reply to Thread
Results 1 to 6 of 6

When cell changes, execute code

  1. #1
    Registered User
    Join Date
    02-10-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    4

    When cell changes, execute code

    Hi,
    Pretty much when cell J26 changes (it is linked to another cell), I want it to execute [Sub MRP_trickledown].
    I did some searching but wasn't completely sure on how to use this

    Please Login or Register  to view this content.

    Also, does it matter where I put the private sub?
    Last edited by kirkland; 02-15-2012 at 09:07 AM.

  2. #2
    Forum Contributor
    Join Date
    02-07-2011
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    128

    Re: When cell changes, execute code

    you should put the private sub event in its worksheet where the J26 cell need to be changed

  3. #3
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: When cell changes, execute code

    try this

    Please Login or Register  to view this content.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  4. #4
    Registered User
    Join Date
    02-10-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: When cell changes, execute code

    ^I've tried that and nothing seems to be happening. I've even tried putting


    msgbox "helloworld"

    instead of my code and nothing


    Is the location of the Private Sub Worksheet_Change(ByVal Target As Range) important?
    Also, the sheet that J26 is called "Phase II" does that change anything?

  5. #5
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: When cell changes, execute code

    Of course the place of code is important You should have it in sheet's module (mark the name of sheet and clik right key of mouse and choose "view code" and there place it) and the name of sheet has nothing to do with working of this code
    Last edited by tom1977; 02-15-2012 at 06:53 AM.

  6. #6
    Registered User
    Join Date
    02-10-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: When cell changes, execute code

    Ahhh, I put it in the same sheet, but that wasn't the issue. It wasn't recognizing when the cell was changing (I had it linked to another equation, and when the equation changed, it wouldn't execute my function).

    but I found a way around it now. thank you so much!

+ 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