Working with Defined Ranges on a Worksheet Through a MacroLast reviewed: November 2, 1994Article ID: Q44274 |
The information in this article applies to:
SUMMARYThe macro below allows you to work with several defined ranges on a worksheet. This macro redefines the variable "range" 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 "range" 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("last",COLUMNS(NAMES())) =FOR("count",1,last,1) =SET.NAME("range",INDEX(NAMES(),1,count)) <Insert here the code you wish execute on the defined range.> =NEXT() =RETURN() |
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |