ForceRecalc


ForceRecalc is a vba function that takes 3 arguments and must be called as: ForceRecalc( numberOfResolvedErrors , level , errorsOnly )
It returns TRUE on success and FALSE on failure.
This function is used to force the recalculation of all formulas that satisfy certain criteria.
It simulates the effect of clicking on one of the menu items appearing under the Recalc ribbon button

The first argument numberOfResolvedErrors is effectively returned by this function.
It must be supplied as a variable of type Integer in order to be set by the function only in the case where errorsOnly = TRUEB to the number of formulas that ceased to return error after their recalculation.
The second argument level is an integer from 0 to 3, interpreted as follows:
 0 for processing the formuals in all open workbooks
 1 for processing the formuals in the active workbook only
 2 for processing the formuals in the active worksheet only
 3 for processing the formuals in the selected range only
The third argument errorsOnly is a boolean interpreted as follows:
 FALSE for recalculating all formulas regardless of their current output.
 TRUE for processing only those formulas that currently return error.