Microsoft KB Archive/68509

Macro Error in FOR.CELL Statement When Argument Type Is Wrong PSS ID Number: Q68509 Article last modified on 02-26-1993 PSS database name: W_eXceL

3.00

WINDOWS

Summary:

The Microsoft Excel version 3.00 macro command FOR.CELL(ref_name,area_ref,skip_blanks) will only accept TRUE or FALSE for its optional skip_blanks argument. Substitutes for TRUE/FALSE, such as 1 or 0, will cause a macro error.

For example, the following will cause a macro error

A1: =FOR.CELL(“Cur_Cell”,,0) A2: [macro code here] A3: =NEXT

where the below statement will execute properly:

A1: =FOR.CELL(“Cur_Cell”,,TRUE) A2: [macro code here] A3: =NEXT

Microsoft has confirmed this to be a problem in Excel for Windows version 3.0. This problem was corrected in Microsoft Excel for Windows version 4.0.

More Information:

Note that area_ref and skip_blanks are optional arguments. This problem will not arise if skip_blanks is omitted.

Reference(s):

“Microsoft Excel Function Reference.” Page 80.

Copyright Microsoft Corporation 1993.