add and remove rows from a called range

B

Buddy Lee

I have a range A1:D3 called "range" and I need to add rows to this range
( A1:D3 => A1:D4 => A1:D5)
and I need to remove them too. How should I do this?

Thank you
 
T

Tom Ogilvy

set rng = Range("A1:D3")
rng.rows(rng.rows.count).Insert shift:=xlShiftDown
? rng.Address
$A$1:$D$4

if you mean a named range
set rng = Range("A1:D3")
rng.name = "Range"
? Range("Range").Address
$A$1:$D$3
Range("Range").Rows(Range("Range").Rows.Count).Insert Shift:=xlShiftDown
? rng.Address
$A$1:$D$4
? Range("Range").Address
$A$1:$D$4
 
G

Guest

Maybe I missed it, but what about removing rows? From the range object only,
and not from the worksheet as well as Range.Delete would do?

Thanks,

Anton
 

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