Microsoft KB Archive/77800

{|
 * width="100%"|

Excel: SELECT Function Interprets Relative Names Differently

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 2.1, 3.0, 4.0
 * Microsoft Excel for the Macintosh, versions 1.x, 2.x, 3.0, 4.0
 * Microsoft Excel for OS/2, versions 2.2 and 3.0

-

SUMMARY
In Microsoft Excel, if you define the name &quot;boo&quot; on the active worksheet as an absolute reference, the following macro command selects the cell that is defined as &quot;boo&quot; on the active worksheet:

  =SELECT(!boo)

However, if you define &quot;boo&quot; as a relative reference, Excel selects relative to the position of the SELECT statement in the macro sheet rather than relative to the active cell. In other words, if the SELECT(!boo) command is in cell A2 of the macro sheet, the cell that is selected is always relative to cell A2 on the active worksheet.

This behavior is part of the SELECT statement's design, but it may return unexpected results in some cases.

MORE INFORMATION
The following macro statement correctly selects the cell relative to the active cell on the active worksheet:

  =SELECT(&quot;boo&quot;)

The exclamation mark is not necessary because the quotation marks cause Excel to assume that &quot;boo&quot; is defined on the active worksheet.

This behavior occurs if you do not include quotation marks because Excel interprets the position of &quot;boo&quot; and passes the resulting reference to the SELECT command. If &quot;boo&quot; is interpreted, Excel references the cell containing the SELECT command.

If you enclose &quot;boo&quot; in quotation marks, Excel passes the name itself to the SELECT command for interpretation, rather the resulting reference. This allows the SELECT command to interpret the location based on the active cell on the worksheet.