How about another way. Is the question in the first post a theoretical one (before you wrote the code) or a practical one (the code doesn't work properly)? If it's the latter, show the code that doesn't work properly, describe how the processed data looks, and point out the problem.
Artik
It is an existing spreadsheet and an existing macro. I put the delay in the macro
provisionally to ensure that all of the formulas are finished updating after writing a value to a cell and before I start reading other cells that are the result of all of the formulas. I can't tell for sure if it fails or not without the delay. I can tell that it mostly does not fail without the delay (through experiments with and without the delay), but I don't think it is possible to know for sure. That is why I am asking if you know a list of the formulas that are asynchronous, so I can check to see if I use any of them.
Here is a significantly over simplified pseudo code for what I am doing...
VBA Code:
For valueIter = 1 to 10 Step 1
Worksheets("MyData").Cells(1,2).Value = valueIter
myZ = Worksheets("MyData").Cells(2,2).Value
Next valueIter
Here is a significantly over simplified table in the worksheet "MyData"
X | 1 | | | Foo1 | Foo2 | Foo3 | |
Z | =INDEX(F2:F5, MATCH("Item2", D2:D5, 0)) | | Item1 | =fx(X) | =fx(X) | =fx(X) | |
| | | Item2 | =fx(X) | =fx(X) | =fx(X) | |
| | | Item3 | =fx(X) | =fx(X) | =fx(X) | |
| | | Item4 | =fx(X) | =fx(X) | =fx(X) | |
| | | | | | | |
The problem is that there are 20-30 tables like the Foo/Item table above with up to 10s of thousands of values in them but more importantly the the values in the tables are the result of many
chained reaction formulas that are dependent on X but are dependent on several other tables, several other formulas, and other spreadsheets that the value is dependent on. And there are also thousands of "Z"s.
My issue is that I can't tell for sure that all of the "Z"s will always be correct without the delay. I have done experiments with and without the delay and it seems like most of the "Z"s are the same/correct value, but I cannot be sure that all of them updated correctly and I was not sure if every time that I run the macro the timing would be consistent.
So, it would help greatly if you could share with me any formula types that calculate
asynchronously so that I can check all of the formulas in my spreadsheet. This would give me confidence that I don't need the delay. Without the delay the macro takes 1 hr to run with the delay it takes 3 hrs to run, so the time savings would be significant.