#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default bottom row

How would you find the last non-empty row on a worksheet
without regard to a specific column?

TIA
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default bottom row

Hi Mike

You can use this example that use a function

Sub test()
MsgBox LastRow(ActiveSheet)
End Sub

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function






--
Regards Ron de Bruin
http://www.rondebruin.nl


"Mike Archer" wrote in message ...
How would you find the last non-empty row on a worksheet
without regard to a specific column?

TIA
Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default bottom row

'-----------------------------------
Sub RealLastRow()
Set foundcell = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows)
MsgBox (foundcell.Row + 1)
End Sub
'----------------------------------

--
Message posted from http://www.ExcelForum.com

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
Top 5 vs Bottom 5 Chad Portman Excel Discussion (Misc queries) 1 September 21st 09 03:52 AM
AT BOTTOM amr Excel Discussion (Misc queries) 1 April 20th 09 01:23 PM
dislike jump bottom of column by double-clicking the bottom of cel Joe Excel Discussion (Misc queries) 1 April 9th 06 09:27 PM
Top to bottom TyeJae Excel Discussion (Misc queries) 8 September 8th 05 10:32 PM
how to paste data from top to bottom to bottom to top Dave Peterson Excel Discussion (Misc queries) 0 January 25th 05 12:12 AM


All times are GMT +1. The time now is 11:09 PM.

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

About Us

"It's about Microsoft Excel"