+ Reply to Thread
Results 1 to 4 of 4

VBA Evaluate Formula value randomly only updates after worksheet/workbook re-calculated

  1. #1
    Registered User
    Join Date
    03-29-2023
    Location
    Sydney, Australia
    MS-Off Ver
    Microsoft Office 2010
    Posts
    5

    VBA Evaluate Formula value randomly only updates after worksheet/workbook re-calculated

    Hi,

    For some reason the Evaluate formula within my VBA script is not always correctly updating/recalculating the correct value.

    Please Login or Register  to view this content.
    The formula is an array formula which looks to determine the relevant value across a range of filtered cells.

    Each cycle, the range of cells is changed and the new compVal must be determined.

    Unfortunately, sometimes the CompVal does not recalculate correctly and returns a value of 0. If I then recalculate the sheet via
    Please Login or Register  to view this content.
    and re-apply the evaluate formula in my VBA code, the CompVal will update to the correct value.

    Due to the large amount of data in my worksheet and the number of cycles required, recalculating is adding hours/days to the total run-time of my macro.

    Does any one know what might be causing the issue and how it could be fixed?

    Any help would be greatly appreciated.

    Thanks.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: VBA Evaluate Formula value randomly only updates after worksheet/workbook re-calculate

    Without VBA, SUBTOTAL(OFFSET may help a lot with formula based option
    But it is volatile formula, and cause the PC become slow, for large data.
    With VBA, I believe there is no reason to use that complex formula combination.
    If you are willing to get better VBA solution, try to upload a sample worksheet.
    Quang PT

  3. #3
    Registered User
    Join Date
    03-29-2023
    Location
    Sydney, Australia
    MS-Off Ver
    Microsoft Office 2010
    Posts
    5

    Re: VBA Evaluate Formula value randomly only updates after worksheet/workbook re-calculate

    Bebo,

    Thanks for your suggestion.

    I have had issues trying to determine the correct formula. The one I am currently using essentially works, so I don't want to change if it's not necessary.

    Is the reason the formula doesn't update the value randomly due to its volatile nature?

    Thanks.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,922

    Re: VBA Evaluate Formula value randomly only updates after worksheet/workbook re-calculate

    Your formula is not in a worksheet so it's not volatile. (AFAIK SUBTOTAL is not volatile anyway)

    The 0 value suggests your SUBTOTAL formula is returning an error - hard for us to say why that would be when there is no context provided.
    Rory

+ 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. Replies: 0
    Last Post: 02-16-2022, 03:56 AM
  2. Screen updates randomly shows other pages!! Please Help
    By marvinabou7890 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2016, 06:49 PM
  3. Replies: 4
    Last Post: 09-16-2015, 03:02 PM
  4. Replies: 8
    Last Post: 02-17-2015, 04:45 PM
  5. macro to cycle through randomly named worksheet in workbook
    By benji* in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-25-2011, 05:15 AM
  6. Macro error - 1004 Happens Randomly - Using Evaluate
    By Dulanic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2010, 11:38 AM
  7. Trying again for workbook formula updates
    By Paulie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-02-2005, 12:06 PM

Tags for this Thread

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