Selecting Noncontinuous Ranges by Name in an Excel Macro

ID: Q49425


The information in this article applies to:


SUMMARY

To select more than one range in a macro, the ranges can be named and then used in a SELECT statement, as in the following sample macro:


   =ACTIVATE("Sheet2")
   =SELECT("area1,area2,area3") 


The cells on Sheet2 have been defined as follows:


   Cell Range    Defined As
   ----------    ----------

   A1 to C3      area1
   D5 to G7      area2
   A9 to G12     area3 


The first cell in the first named range is the active cell. In the above example, it is A1.

Additional query words:


Keywords          : 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: March 15, 1999