How to create a range from two ranges in VBA?

Like this?

Sub Sample()
    Dim rng1 As Range, rng2 As Range
    Dim NewRng As Range

    With ThisWorkbook.Sheets("Sheet1")
        Set rng1 = .Range("A1")
        Set rng2 = .Range("C3")

        Set NewRng = .Range(rng1.Address & ":" & rng2.Address)

        Debug.Print NewRng.Address
    End With
End Sub

Instead of R1C1 format use Cells(r,c). That will give you more flexibility + control

So Range("A2") can be written as Cells(2,1)

Leave a Comment