Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default Find last row with hidden rows

I am using the following code to find the last row of a worksheet. It works
fine as long as the last used row is unhidden. But it I hide it, then this
does not work as I want. I need to find the absolute last row whether it is
hidden or unhidden.

Can anyone help?

FindLastRow = objSheet.Cells.SpecialCells(xlCellTypeLastCell).Ro w
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Find last row with hidden rows

Try

lastrow = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row

Mike

"Sherry" wrote:

I am using the following code to find the last row of a worksheet. It works
fine as long as the last used row is unhidden. But it I hide it, then this
does not work as I want. I need to find the absolute last row whether it is
hidden or unhidden.

Can anyone help?

FindLastRow = objSheet.Cells.SpecialCells(xlCellTypeLastCell).Ro w

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default Find last row with hidden rows

Works GREAT! Thank you.

"Mike H" wrote:

Try

lastrow = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row

Mike

"Sherry" wrote:

I am using the following code to find the last row of a worksheet. It works
fine as long as the last used row is unhidden. But it I hide it, then this
does not work as I want. I need to find the absolute last row whether it is
hidden or unhidden.

Can anyone help?

FindLastRow = objSheet.Cells.SpecialCells(xlCellTypeLastCell).Ro w

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hidden rows columns won't stay hidden christie Excel Worksheet Functions 0 September 30th 08 05:44 PM
Formula or Code to keep Hidden Rows Hidden Carol Excel Worksheet Functions 6 May 1st 07 11:45 PM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM
Excel 2003 -Rows hidden. Scrolling unhides rows ! How do I stop th Excellent1975 Excel Discussion (Misc queries) 0 June 21st 06 08:01 PM
deleting hidden rows so i can print only the rows showing?????? jenn Excel Worksheet Functions 0 October 6th 05 04:05 PM


All times are GMT +1. The time now is 05:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"