Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
bottom row
How would you find the last non-empty row on a worksheet
without regard to a specific column? TIA Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Top 5 vs Bottom 5 | Excel Discussion (Misc queries) | |||
AT BOTTOM | Excel Discussion (Misc queries) | |||
dislike jump bottom of column by double-clicking the bottom of cel | Excel Discussion (Misc queries) | |||
Top to bottom | Excel Discussion (Misc queries) | |||
how to paste data from top to bottom to bottom to top | Excel Discussion (Misc queries) |