1

I have a statement in VBA to create a Range, which then is selected and copied. After that I paste that somewhere else. But the last line is pasted without a newline, so I'd like to extend my range by one. My current statement is:

Set twoRange = Range("A2", Range("A2").End(xlDown))
twoRange.Select
twoRange.Copy

What is the simplest way to extend this range one row down?

2 Answers 2

3

Yes:

Set twoRange = Range("A2", Range("A2").End(xlDown).Offset(1))
twoRange.Copy

You use Offset to move one more cell down. Offset uses this format: `Offset(Rows,[columns])

You also do not need to select the range to copy the range.

1
  • 1
    you don't even need to set the range and go: Range("A2", Range("A2").End(xlDown).Offset(1)).Copy Commented Jan 25, 2017 at 22:03
0

You can do

Set twoRange = Range("A2:A" & Range("A2").End(xlDown).Row + 1)

which adds one to the row found by using the xlDown approach.

Not the answer you're looking for? Browse other questions tagged or ask your own question.