Find Last Row Hidden

  • Thread starter Thread starter John Wilson
  • Start date Start date
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
 
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 !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top