Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi folks, hope someone can help with this little tear-your-hair-out
number. I have an array formula that I use to calculate row-by-row totals from a table range. It looks like this: =SUM(OFFSET(TableWks,ROW(Wks_Total)-10,0,1,COLUMNS(TableWks))) where TableWks is a multi-column, multi-row table, and Wks_Total is the calculating column itself. There is no problem with the array formula; it does exactly what I want it to do. Except when I run a VBA procedure (what it does is not important, I don't think); the result of the array formula comes up the same in every row, corresponding to the sum of the first column in TableWks, at procedure's end. A simple tap of the F9 key, however, and it corrects itself. I think this corresponds to some sort of array formula/volatility problem as discussed here http://www.decisionmodels.com/calcsecretsj.htm but none of the fixes there worked. Indeed, I've tried every fix I can think of, including: - not setting calculate to Manual at proc's start or restoring it to Automatic at proc's end - liberal use of DoEvents - liberal use of .Calculate and .EnableCalculation - various forms of copying/pasting the .FormulaArray of Wks_Total - various forms of manually setting .FormulaArray at runtime and none of them work. I have tried this in both Excel 2007 and 2003, both running on Windows XP. As I say, simply invoking calculate on the sheet--nothing deeper-- causes the array results to right themselves, as soon as the app state has returned to user control. But something is keeping this formula from working right while under VBA control. Thanks in advance for any thoughts you might have. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why doesn't this array formula calculate properly using VBA? | Excel Worksheet Functions | |||
functions do not calculate correctly | Excel Worksheet Functions | |||
How come Excel can't calculate any =SIN(x) or =COS(y) correctly? | Excel Discussion (Misc queries) | |||
Excel won't calculate my formulas correctly. | Excel Worksheet Functions | |||
Formula doesn't calculate correctly | Excel Worksheet Functions |