Excel: Operation Performs on One Cell Only in a FOR.CELL LoopID: Q79136
|
A FOR.CELL loop repeats instructions over a range of cells, one cell at a time. However, the active cell does not move during the loop's execution. This may cause problems if you have instructions within the body of the loop that operate on the active cell.
The first argument to the FOR.CELL command is ref_name. This is a name
in the form of text that refers to the n-th cell in the selection upon
the n-th pass through the loop. The example shown below will replace
the contents of the active cell with the cubed root of the current
value of the active cell:
A1: CubeRoot
A2: =FOR.CELL("CurrentCell")
A3: =FORMULA(CurrentCell^(1/3))
A4: =NEXT()
A5: =RETURN()
A1: CubeRoot
A2: =FOR.CELL("CurrentCell")
A3: =FORMULA(CurrentCell^(1/3),CurrentCell)
A4: =NEXT()
A5: =RETURN()
A1: =FOR.CELL("Current")
A2: =SELECT(Current)
A3: =FORMAT.FONT(2)
A4: =NEXT()
A5: =RETURN()
"Microsoft Excel Functions Reference," version 3.0, page 80
Additional query words: 5.00 3.00 docerr command format font for cell 4.0 4.00
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: March 23, 1999