Creating a Range from two specified Ranges

  • Thread starter Thread starter PeterWilliams
  • Start date Start date
P

PeterWilliams

Hi, I want to create a range where the begin and end cells are specified
by two other Range variables. For example,

Set r1 = ActiveSheet.Range("C5")
Set r2 = ActiveSheet.Range("E8")

How can I define r3 to contain the range "C5:E8" using these two?

Thanks in advance.
 
try this, but i wouldn't use r1 and r2, those are cell addresses

Sub test()
Dim rng1 As Range, rng2 As Range, rng3 As Range
Set rng1 = ActiveSheet.Range("C5")
Set rng2 = ActiveSheet.Range("E8")
Set rng3 = Range(rng1, rng2)
rng3.Select
End Sub


Gary


--


Gary


"PeterWilliams" <[email protected]>
wrote in message
news:P[email protected]...
 

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

Back
Top