![]() |
naming multiple ranges
I need to name mulitple ranges of cells that aren't connected. I tried:
Set rng1 = Range(xcell.Offset(2, 2), xcell.Offset(11, 2)) Set rng2 = Range(xcell.Offset(14, 2), xcell.Offset(59, 2)) Set rng3 = Range(xcell.Offset(62, 2), xcell.Offset(70, 2)) Set rng = Range(rng1, rng2, rng3) rng.name = "alsestrng" The set rng code doesn't work. How do I need to do this? Thanks |
naming multiple ranges
Have you tried
Set rng1 = Union(xcell.Offset(2, 2), xcell.Offset(11, 2)) -- HTH, Barb Reinhardt "ranswrt" wrote: I need to name mulitple ranges of cells that aren't connected. I tried: Set rng1 = Range(xcell.Offset(2, 2), xcell.Offset(11, 2)) Set rng2 = Range(xcell.Offset(14, 2), xcell.Offset(59, 2)) Set rng3 = Range(xcell.Offset(62, 2), xcell.Offset(70, 2)) Set rng = Range(rng1, rng2, rng3) rng.name = "alsestrng" The set rng code doesn't work. How do I need to do this? Thanks |
naming multiple ranges
Set rng = Union(rng1, rng2, rng3)
rng.Name = "alsestrng" Regards, Peter T "ranswrt" wrote in message ... I need to name mulitple ranges of cells that aren't connected. I tried: Set rng1 = Range(xcell.Offset(2, 2), xcell.Offset(11, 2)) Set rng2 = Range(xcell.Offset(14, 2), xcell.Offset(59, 2)) Set rng3 = Range(xcell.Offset(62, 2), xcell.Offset(70, 2)) Set rng = Range(rng1, rng2, rng3) rng.name = "alsestrng" The set rng code doesn't work. How do I need to do this? Thanks |
naming multiple ranges
Thank You
"Peter T" wrote: Set rng = Union(rng1, rng2, rng3) rng.Name = "alsestrng" Regards, Peter T "ranswrt" wrote in message ... I need to name mulitple ranges of cells that aren't connected. I tried: Set rng1 = Range(xcell.Offset(2, 2), xcell.Offset(11, 2)) Set rng2 = Range(xcell.Offset(14, 2), xcell.Offset(59, 2)) Set rng3 = Range(xcell.Offset(62, 2), xcell.Offset(70, 2)) Set rng = Range(rng1, rng2, rng3) rng.name = "alsestrng" The set rng code doesn't work. How do I need to do this? Thanks |
All times are GMT +1. The time now is 03:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com