Excel: Selecting Noncontiguous Ranges with a MacroLast reviewed: July 16, 1997Article ID: Q87324 |
The information in this article applies to:
SUMMARYWhen selecting multiple noncontiguous ranges in a macro, a comma must be used to separate the ranges. To select noncontiguous areas using range names as cell references, the REFTEXT() function must be used.
MORE INFORMATIONTo select multiple noncontiguous ranges in a macro using cell references to define a range, each range must be separated by a comma.
Example=SELECT("r1c1:r5c2,r1c4:r5c5,r1c7:r5c8") To select multiple noncontiguous ranges in a macro using the defined name solution, use SELECT. Range names must be separated by a comma.
Example=SELECT((!name1,!name2,!name3)) When selecting areas using defined names, the range names must be enclosed in a REFTEXT() function.
Example=SELECT(REFTEXT(!name1)&","&REFTEXT(!name2)&","&REFTEXT(!name3))
REFERENCES"Microsoft Excel Function Reference," version 3.0, pages 192, 209-210 "Microsoft Excel Function Reference," version 4.0, pages 349, 378-379
|
Additional query words: 5.00 3.00 4.00 3.0 4.0 adjacent discontinuous
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |