Microsoft KB Archive/44274

-

{| 2.x 3.00 4.00 4.00a 5.00 | 2.20 2.21 3.00 WINDOWS                 | OS/2 kbusage The information in this article applies to:
 * width="100%"|


 * Microsoft Excel for Windows, version 2.x, 3.0, 4.0, 4.0a, 5.0
 * Microsoft Excel for OS/2 versions 2.2, 2.21, 3.0

SUMMARY
The macro below allows you to work with several defined ranges on a worksheet. This macro redefines the variable &quot;range&quot; to refer to the different named ranges on the worksheet. You can have any number of defined ranges. The code between SET NAME and NEXT can use the variable &quot;range&quot; to refer to the defined range on the worksheet. For example, if you place

=SELECT(range) there, the macro selects the different defined ranges from the worksheet. The macro is as follows: =SET.NAME(&quot;last&quot;,COLUMNS(NAMES)) =FOR(&quot;count&quot;,1,last,1) =SET.NAME(&quot;range&quot;,INDEX(NAMES,1,count))



=NEXT =RETURN
 * }

-

Last reviewed: November 4, 1994

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.