ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selection's first and last row (https://www.excelbanter.com/excel-programming/315541-selections-first-last-row.html)

Tim Coddington

Selection's first and last row
 
What is the best way to collect the first and last row numbers of a
currently selected area of a spreadsheet?



Tom Ogilvy

Selection's first and last row
 
If selection.Areas.count = 1 then
firstRow = selection(1).Row
lastRow = selection(selection.count).row
End if

--
Regards,
Tom Ogilvy

"Tim Coddington" wrote in message
...
What is the best way to collect the first and last row numbers of a
currently selected area of a spreadsheet?





Tim Coddington

Selection's first and last row - Thank Tom!!
 
Thanks, Tom

"Tom Ogilvy" wrote in message
...
If selection.Areas.count = 1 then
firstRow = selection(1).Row
lastRow = selection(selection.count).row
End if

--
Regards,
Tom Ogilvy

"Tim Coddington" wrote in message
...
What is the best way to collect the first and last row numbers of a
currently selected area of a spreadsheet?








All times are GMT +1. The time now is 03:26 AM.

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