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.
Bookmarks