ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating Non-Contiguous Cell Ranges (https://www.excelbanter.com/excel-programming/309073-creating-non-contiguous-cell-ranges.html)

[email protected]

Creating Non-Contiguous Cell Ranges
 
Can someone explain how you take specific cells from a parent range
and create a non-contiguous child range that uses some of the cells
from the parent range?


Tom Ogilvy

Creating Non-Contiguous Cell Ranges
 
set rng = Range("A1,A3,A5,A7")

rng.Name = "Child1"

or
set rng = Range("A1")
for i = 3 to 11 step 2
set rng = union(rng,cells(i,1))
Next
rng.Name = "Child1"

any method would depend on how you are choosing/identifying the subset.

--
Regards,
Tom Ogilvy


" wrote in message
...
Can someone explain how you take specific cells from a parent range
and create a non-contiguous child range that uses some of the cells
from the parent range?





All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com