+ Reply to Thread
Results 1 to 6 of 6

Find out if a cell is dirty/needs calculation

  1. #1
    Registered User
    Join Date
    09-01-2018
    Location
    Germany
    MS-Off Ver
    2003
    Posts
    2

    Find out if a cell is dirty/needs calculation

    Hello all,

    does anybody know if there is a way to check if a Range needs to be recalculated?
    The image attached is a simplified version of the workbook I have. Cell D7, D8 contains a matrix function I wrote in VBA. It is dependent on the cells B7, B8, B9, ..., B8198. These cells however depend on cell B3.
    When I change the cell B3 the following happens. Cell B7 is recalculated. Because of that my function in D7 is recalculated. Then B8, my function in D7 again, B9, D7, B10, D7, ...
    My problem is, that my function in D7 needs about ~1s of calculation time...
    It would be much faster if the calculation in D7 started after all cells in column B are updated. If there was a way to find out if the cells in column B aren't updated it would be easy to cancel calculation of D7 in that case.

    dependent cells.jpg

    With kind regards,
    Eric

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Find out if a cell is dirty/needs calculation

    Doing the calculations in VBA would eliminate that problem.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,313

    Re: Find out if a cell is dirty/needs calculation

    What does your function do that it takes a second or so to execute? Maybe you could improve its performance.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    09-01-2018
    Location
    Germany
    MS-Off Ver
    2003
    Posts
    2

    Re: Find out if a cell is dirty/needs calculation

    Thanks for your replies.

    Doing the calculations of column B in VBA is not as comfortable as I originally wanted. But it definitely works.
    When there is no way to check the dirtiness of a cell I think I can live with that. Thanks.

    Sorry, ~1 s for the function call was just my feeling. After measuring it seems to be around 50 ms. But for about 8000 cells that still makes >5 min. It's a FFT implementation and I don't think I can get it much faster.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Find out if a cell is dirty/needs calculation

    You're welcome and thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

    * Check out this thread
    Last edited by xladept; 09-02-2018 at 12:44 PM.

  6. #6
    Registered User
    Join Date
    07-02-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    1

    Cool Re: Find out if a cell is dirty/needs calculation

    you could do a trick, Read the range that you want to check for dirty cells into an array (don't perform this on the whole sheet or you might run out of time!)
    then calculate the sheet, and then compare the re-calculated sheet against the values in the array. The changed values were dirty before the calculation.

    Try this

    Please Login or Register  to view this content.

+ 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. Cleaning a dirty sheet.
    By rbs123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2014, 04:27 AM
  2. [SOLVED] What can stop a cell from being marked "Dirty"?
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2012, 07:00 AM
  3. Evaluate Formula - Dirty Little Excel Developer's Secret
    By Whizbang in forum The Water Cooler
    Replies: 13
    Last Post: 09-27-2011, 08:26 AM
  4. mark Excel title bar for dirty documents
    By mtreadwell in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-26-2008, 06:43 AM
  5. How to check if Excel is Dirty on changing Cell Value
    By ShekharG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2008, 04:15 AM
  6. [SOLVED] Removing Dirty Data From an Imported DOS database
    By Iain Scott in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2006, 12:40 PM
  7. using Dirty Method
    By Giselle in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-06-2006, 09:25 PM
  8. [SOLVED] Clear dirty flag when workbook is opened
    By Carl Lindmark in forum Excel General
    Replies: 9
    Last Post: 04-12-2005, 05:06 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