+ Reply to Thread
Results 1 to 5 of 5

How to make a Worksheet Calculate event when a range of cells change?

  1. #1
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    How to make a Worksheet Calculate event when a range of cells change?

    Hi,

    I have the following code that I would like to trigger when cells B26:U26 change to something other then 0 due to a formula? How was I make this happen??


    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to make a Worksheet Calculate event when a range of cells change?

    The only way I know of to detect a change in the result of a formula is to do a Worksheet_Change event on the worksheet containing the data on which the formula is based. If all your data is in one worksheet then this becomes pretty easy.

    Second, when you say cells "B26:U26 change to something other then 0" do you mean any of them, or all of them? Here is how you would do this if the formulas in that range use precedents on the same sheet, and you are interested in whether any of them are non-zero. However, note that this will also run if something on the sheet changes and none of the cells in B26:U26 have changed. If you need that amount of control, you need to do analysis for specifically what can cause a change to the values in those cells. As is often the case, if you attach your file I could give a more comprehensive answer.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: How to make a Worksheet Calculate event when a range of cells change?

    Thanks for the reply, I will attach the sheet for you to look at. Basically in sheet2 there is some calculations that are running from an RTD client that is updating values, anything with RTD or linking to sheet2 will be constantly updating. Ideally I only want Gseek and gseek1 to run when any of the cells in B26:U26 are not 0. Its slightly over my vba skills and comprehension, thanks for the help.

    Options Vol.xlsm

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to make a Worksheet Calculate event when a range of cells change?

    Try this, although the data is all #N/A so I couldn't test it and I have no idea whatsoever what RTD is.

    Edit: Your existing code checked for a Worksheet_Change on Sheet3, but the data on Sheet3 never changes so it will never be called. Everything on Sheet3 is a formula that refers to other formulas in Sheet3, or to data on Sheet2. So you have to detect the Worksheet_Change on Sheet2, and then manage the results in Sheet3. There is now code in the modules for both sheets.
    Attached Files Attached Files
    Last edited by 6StringJazzer; 02-15-2014 at 06:22 PM.

  5. #5
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: How to make a Worksheet Calculate event when a range of cells change?

    Hey I changed the code to worksheet calculate instead of change, it wasn't doing anything once I ran the client to make the RTD functions return numbers. When I changed it to calculate it worked for a few iterations but then it went haywire on me and the values for the Vol started to be like 800000000000000000000000000000000000000000000%. Not sure why but... I can provide you the information to use the RTD function in a PM if you are interested.

+ 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. need worksheet change event to fire when pasting; for all cells in paste range
    By ShoshanaM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2012, 10:10 AM
  2. Worksheet change event for range of cells and data validation
    By santosh123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-08-2012, 07:38 AM
  3. Worksheet Change Event-change the range in my VBA
    By systemx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2006, 05:00 AM
  4. Replies: 5
    Last Post: 06-23-2005, 06:05 PM
  5. Worksheet Change Event-when a cell with a certain range of cells) are changed?
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-25-2005, 07:06 PM

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