ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   xlCellTypeLastCell (https://www.excelbanter.com/excel-programming/310696-xlcelltypelastcell.html)

Kevin McCartney

xlCellTypeLastCell
 
Hi, I've been using the following code to ascertain the last typed cell, but
I have the problem of that when there is a data filter selected it doesn't
include the hidden rows, so it just returns the last visible cell, therefore
is there another function that will return the actual last cell even if there
is a data filter selected.

TIA

KM


Tom Ogilvy

xlCellTypeLastCell
 
Depends on your data, but perhaps

set rng = range("A1").currentRegion
lastRow = rng.rows(rng.rows.count).Row

--
Regards,
Tom Ogilvy

"Kevin McCartney" wrote in
message ...
Hi, I've been using the following code to ascertain the last typed cell,

but
I have the problem of that when there is a data filter selected it doesn't
include the hidden rows, so it just returns the last visible cell,

therefore
is there another function that will return the actual last cell even if

there
is a data filter selected.

TIA

KM





All times are GMT +1. The time now is 12:30 PM.

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