View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Last Row of Selection

Maybe easier to read:

with selection
LastRow = .Rows(.Rows.Count).Row
end with

and I like:

with selection
LastRow = .cells(.cells.Count).Row
end with

(just to be different!)


Mike Fogleman wrote:

LastRow = Selection.Rows(Selection.Rows.Count).Row

Not much prettier and much more difficult to read.

Mike F
"Bill" wrote in message
link.net...
Hello,
Is there a different way of getting the last row of a selection? The
first row is selection.rows(1).row, but I can't get the last row without
counting rows and subtracting one.

lastrow = selection.rows(1).row+selection.rows.count-1

Thanks.

Bill


--

Dave Peterson