ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find the row of all cells in a selection (https://www.excelbanter.com/excel-programming/275803-find-row-all-cells-selection.html)

TonyJeffs

Find the row of all cells in a selection
 
If I select a block of cells, C14:F19
- and then run a subroutine:

msgbox selection.row

-That would read 14, the first row in the selection.
but how can I obtain the last row in the selection?
...................


Thanks
Tony

Alan Beban[_3_]

Find the row of all cells in a selection
 
And another:

Selection(Selection.Rows.Count, 1).Row

Alan Beban

J.E. McGimpsey wrote:
One way:

With Selection
MsgBox .Item(.Count).Row
End With

another:

With Selection
MsgBox .Row + .Rows.Count - 1
End With



In article ,
(TonyJeffs) wrote:


If I select a block of cells, C14:F19
- and then run a subroutine:

msgbox selection.row

-That would read 14, the first row in the selection.
but how can I obtain the last row in the selection?
..................


Thanks
Tony





All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com