Does anyone know how to force a cell re-calculation
I don't think I've ever seen anyone complain about all workbooks that they open
having this problem. But a few/lots of people have complained about individual
workbooks.
One suggestion is to re-enter every formula in the workbook.
One way is to select all the worksheets
edit|replace
what: = (equal sign)
with: = (equal sign)
replace all
And ungroup the worksheets.
Sometimes it seems to wake up excel's calculation engine.
mickey wrote:
As I mentioned in my request, Excel ONLY re-calculates cells which have
contents that are dependent on other cells which have changed, thus affecting
the value of the cell in question. In my case the current state of the
formula in the target cell does not REQUIRE re-calculation. The .Calculate
method is apparently smart it checks cell dependencies and if none have
changed the .Calculate method is ignored. This is consistent with
information in the Excel help file which states that, to conserve CPU
resources, Excel only re-calculates cells, where dependencies have changed.
I had hoped this only applied to the automatic re-calculation, but apparently
the .Calculate method is SMART. I have confirmed this by forcing a cell
dependency change, and then the .Calculate method does perform a
re-calculation. There is a method which will force a re-calculation of the
entire workbook, but this is not useful for this application. I'm am sure in
your application the .Calculate method worked because the method recognized
changes that required re-calculation.
I have always gone beyond normal constructs to develop creative approaches
to unique problems, unfortunately I've occasionally run into certain
inflexibilities such as the .Calculate method. I was hoping one of the more
advanced users on this forum might know of an undocumented method which would
force the re-calculation.
Thanks.
"havocdragon" wrote:
Without knowing the type of formula that is almost impossible to tell.
Why does application.calculate not work?
I've never had an instance where this didnt work. Including a loop from 1 to
1000 that recalculated all formulas on the work sheet every loop...
"mickey" wrote:
I have a special formula in a cell, which I can cause to be calculated via
the .calculate method in Visual Basic. Unfortunately, if the cell, or any
dependencies do not change issuing another .calculate method does not cause a
re-calculation, which is a good idea in most cases (why waste CPU time
calculating a cell that hasn't changed). But as I said, without getting too
involved with the why, I have a need to FORCE a re-calculation even if the
cell has not changed. I can of course force a change, but I was hoping that
someone knew of some more elegant way around Excel's prohibition on
re-calculating cells that haven't changed.
Any useful suggestions would be greatly appreciated.
--
Dave Peterson
|