The information in this article applies to:
SUMMARYWhen 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. MORE INFORMATION
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.
With a typical FOR statement using SELECT to move from cell to cell, the FORMULA statement will resemble the following:
However, in the case of the FOR.CELL loop, the active cell never changes (because the cursor never moves); therefore, using the name defined in the first argument of FOR.CELL (CurrentCell in this example) is the equivalent. REFERENCES
"Microsoft Excel Function Reference," version 4.0, pages 155-156
Additional query words:
Keywords : |
Last Reviewed: March 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |