Microsoft KB Archive/49425

{|
 * width="100%"|

Selecting Noncontinuous Ranges by Name in an Excel Macro

 * }

-

The information in this article applies to:


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

-

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(&quot;Sheet2&quot;) =SELECT(&quot;area1,area2,area3&quot;)

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 : WINDOWS:2.x,3.0,4.0,4.0a,5.0; :2.2,2.21,3.0

Platform : WINDOWS

Issue type :

Technology :