Hi
if you want the last row in your current selection try
sub foo()
dim rng as range
dim lastrow as long
set rng = selection
lastrow = rng.row+rng.rows.count-1
msgbox lastrow
end sub
if rTarget is your range, then
rTarget.Row is the first row,
rTarget.Rows.Count is the number of rows,
thus then last row is
with rTarget
lastrow = .Row + .Rows.Count -1
end with
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.