Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger a full calculation in VBA

Tags:

excel

vba

Given a workbook that contains lots of formulas, i realise that when its cell values are up-to-date, F9, ActiveWorkbook.Calculate or Sheets(1).calculate does not trigger a re-calculation.

However, if a cell value that is referenced by another cell through formula changes, F9, ActiveWorkbook.Calculate or Sheets(1).calculate will trigger a recalculation of all the formulas that depend on the changed cell.

In one word, Excel just recalculates which is necessary.

However, I would like to measure the behavior (eg, time) of a FULL calculation of the workbook (ie, refreshing from the constant values, then the formulas depending on them, then a higher level formulas...).

Does anyone know how to trigger such a full calculation in VBA?

like image 536
SoftTimur Avatar asked Nov 07 '25 00:11

SoftTimur


1 Answers

You have two options - CalculateFull and CalculateFullRebuild. The latter will rebuild the entire dependency chain so may be overkill here. Note that both will apply to all open workbooks, not just the active one.

like image 156
Rory Avatar answered Nov 09 '25 22:11

Rory



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!