+ Reply to Thread
Results 1 to 2 of 2

Hot get formulas to update in the cells before VBA continues

  1. #1
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Hot get formulas to update in the cells before VBA continues

    I have some code that runs through a series of different actions on open and the final string of code looks at a range of rows (E20:U56) and if a row contains only $0 values then the row is hidden. That range of cells also contains SUMIFS formulas that pull data from another data connected table within the same workbook.

    The VBA looks at the range A20:A56 and that range has the formula =COUNTIF(E20:U20,"<>"&0)<>0 and it is filled down to A56. The code works and the rest of my code runs fine the problem is part of the code causes my data connections to an external database to refresh which is also fine but the calculations in range E20:U56 don't actually update and populate in the cells before the code below has ran so when that string of code is ran and because the formulas in that range haven't updated yet the code sees all rows in that range as containing $0 value so it hides the whole range and then the code finishes and the formulas then update which doesn't help because all of the rows are now hidden. Is it possible for the formulas in the cells to update first and then run the code below once the cells actually have been updated and contain the new values. Just for reference I tried taking the formulas out of the cells and instead programmatically having the code place the formulas in the cells and then running the below code and that didn't work. I assume my limited knowledge of VBA comes into play and the code I used to update the cells with a formula was pretty crude so maybe some body more VBA savvy can help. Thanks in advance.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Hot get formulas to update in the cells before VBA continues

    Force the range refresh using the 'Calculate' method - e.g. such a scheme:
    Please Login or Register  to view this content.
    For a detailed description of 'Calculate', see context help.

+ 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. Macro to update formulas in multiple cells.
    By pancakes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2015, 08:44 AM
  2. [SOLVED] Making formulas that automatically update when adding cells
    By Biffinator in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2014, 05:17 PM
  3. [SOLVED] X-Axis continues to count blank cells with =IF formula in
    By Macnautor in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-22-2012, 11:18 AM
  4. Glitch - Cells with formulas won't update automatically
    By Clue_Less in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-15-2012, 04:03 PM
  5. Macro that Continues an Equation/Format based on the Dynamic Amount of Cells
    By jerroldburke in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-19-2011, 05:23 AM
  6. Continues data table update from external sources
    By ajocius1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-23-2009, 08:41 AM
  7. [SOLVED] Formulas autofill ok but continues to carry tot from 1st column??
    By ET in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-27-2006, 11:00 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