+ Reply to Thread
Results 1 to 7 of 7

Monitoring multiple cells with Worksheet Change

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Monitoring multiple cells with Worksheet Change

    Hello,
    For monitoring MyRange1, I am using:
    Please Login or Register  to view this content.
    I want to add two more ranges to monitor: MyRange2 and MyRange3 and get a message like:
    "MyRange2 CHANGED" or "MyRange3 CHANGED".
    How do I do this?
    Could you please advise?
    Thanks

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Monitoring multiple cells with Worksheet Change

    See if this does what you need.
    Please Login or Register  to view this content.
    This is based on named ranges with workbook scope, if your ranges have worksheet scope with the same name used on more than one sheet then you may encounter errors.

  3. #3
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Monitoring multiple cells with Worksheet Change

    jason.b75,
    This code works fine, however, what I want is to run a different code for each change.
    For example:
    - if I change My Range1 then get a message like "MyRange1 Changed"
    - if I change My Range2 then get a message like "MyRange2 Changed"
    - if I change My Range3 then get a message like "MyRange3 Changed"
    Thanks

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Monitoring multiple cells with Worksheet Change

    That is exactly what it does.

    The code finds which range the target cell falls into then displays the name of the range, followed by the word "changed".

  5. #5
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Monitoring multiple cells with Worksheet Change

    jason.b75,
    Yes, I see, I does the job, but what I need in my situation is, to monitor only those three cells.
    What happens here, is that if a cell is also part of another range like the PrintArea, than it returns the name of the PrintArea instead of the name of that particular cell.
    So partially following your solution, I want to monitor a range which would contain only those three cells; thinking to have a range like RangeToMonitor which would be made up by those three cells.
    Thanks

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Monitoring multiple cells with Worksheet Change

    If you have overlapping named ranges then I think you will need to check each individually, I was trying to simplify the process, but in this case I don't think that it will work.
    Please Login or Register  to view this content.
    I think that this method should do what you need, you can add in more ElseIf lines if needed.

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Monitoring multiple cells with Worksheet Change

    Jumping in here kind of late, but you can change more than one cell and trigger your code.

    If you select more than one cell type a number into the first cell and type control + enter all the cells will change and you will get a match for your range changing if one of the cells was in your range. If you select multiple cells and select delete you have changed all of those cells and again if one of them was in your range you will get a positive with intersect.

    What is done a lot of times is if you are interested in only one cell being changed you start the code with something like the following. You can also write it to deal with more than one cell being changed if you don't want to allow that to happen.

    Please Login or Register  to view this content.
    I'm not sure what you are after and this may be a non issue but I thought I would bring it up.
    Last edited by skywriter; 09-19-2015 at 04:42 PM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Monitoring Sheet for change in cell
    By Lasse Moe in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-08-2014, 07:24 AM
  2. Monitoring Sheet for change in cell
    By Lasse Moe in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-08-2014, 04:32 AM
  3. Monitoring worksheet
    By kmeld in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2013, 05:36 AM
  4. [SOLVED] Worksheet change event to Formulate Cells for multiple Ranges
    By trickyricky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-15-2012, 02:38 PM
  5. Worksheet change event, ignore multiple cells
    By ShaunM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2008, 01:50 AM
  6. Monitoring cells using userform
    By Schwizer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2007, 05:00 PM
  7. [SOLVED] monitoring range change
    By Tufail in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2006, 03:29 AM

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