Quote:
Originally Posted by Guessed
I'm not sure on the purpose of this macro but your loop might work with
Code:
For i = 2 To 100
Range(Range("range" & i), rng0).Select
Set rng0 = Selection
Next i
|
Thank you for your reply. The purpose of this code is to select some nonadjacent defined names which has be named range1, range2 and so on plus a user selected range. (see the attached picture, in which if active cell be A5 and defined names ranges be the colored ranges, the macro is expected to select the colored ranges and A5.)
Your code don’t work like this. (it selects also the cells between defined names, for example A9)