Need function to raplace cell value by a range

E

Excel ESG

In column A I have values(strings) wich I need to replace by ranges
e.g.
range1=("rng1.1","rng1.2","rng1.3")
range2=("rng2.1","rng2.2")
range3=("rng3.1","rng3.2","rng3.3","rng3.4")

range2
range1
range3
should result in
rng2.1
rng2.2
rng1.1
rng1.2
rng1.3
rng3.1
etc

Thank U very much in advance

Shared knowledge makes you smarter
 
N

NickHK

If you mean that "rng1.1","rng1.2" etc are range names, then:
Dim BigRange As Range
Set BigRange = Union(Range("rng1.1"), Range("rng1.2"))

so if these names are held in A1, A2 etc
Dim BigRange As Range
Set BigRange = Union(Range(Range("A1").Value), Range(Range("A1").Value))

Also, I'm not sure if "." is completely safe in a Name. Maybe use "_" to
avoid any issues.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top