Excel: Values Returned in FOR.CELL Loop IncorrectID: Q67468
|
When using a FOR.CELL loop in Microsoft Excel version 3.00 or 4.00, be certain that the modifying statements (such as FORMULA) associated with it are constructed correctly. The first argument of the FOR.CELL function allows you to specify a name that can be used to track the progress of a FOR.CELL loop. It is a common error to use ACTIVE.CELL instead of this specified name.
The FOR.CELL loop allows Microsoft Excel to work on a range of cells
without actually moving the cursor. This greatly enhances macro speed.
However, if functions, such as the FORMULA statement, rely on values
from the active cell, it is important that the name given in the first
argument of the FOR.CELL function is used, rather than the function
ACTIVE.CELL.
The following is a correct example of a FOR.CELL loop that goes to
each nonblank cell in a selection and adds 23:
=FOR.CELL("CurrentCell",,TRUE)
=FORMULA(CurrentCell+23,CurrentCell)
=NEXT()
=RETURN()
=FORMULA(ACTIVE.CELL()+23)
"Microsoft Excel Function Reference," version 4.0, pages 155-156
"Microsoft Excel Function Reference," version 3.0, page 80
Additional query words:
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: March 21, 1999