Find Last Row Hidden

J

John Wilson

Just came across this today.....

Maybe someone can explain ???

I was always under the impression that
Range("A" & Rows.Count).End(xlUp).Row
would give the last row with a value in the chosen column.

If I have data in rows 1 thru 10, the above returns 10.
If I hide rows 9 & 10, it returns 8??

I would have thought that I'd have to specify Visible Cells
to get a result like that.

Thanks,
John
 
B

BrianB

It looks to me (in my ignorance) as if Excel is doing exactly as
requested.

Try this one on your sheet with rows hidden. Once again Excel wins. :-
'---------------------------------------------------------------------
Set foundcell = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlByRows)
MsgBox (foundcell.Row)
'-----------------------------------------------------------------------

It's the way we ask. This is definitely one (two) for the archives.
Thanks for the observation !
 
Top