Excel Help DotXLS Excel Help
www.DotXLS.com
"Yes, Excel can do that!"

How to find the last row or column or cell on a worksheet

How to find the last row with data on a worksheet:

On Error Resume NextMsgBox ActiveSheet.Cells.Find(What:="*", _    SearchDirection:=xlPrevious, _    SearchOrder:=xlByRows).Row

How to find the last column with data on a worksheet:

On Error Resume NextMsgBox ActiveSheet.Cells.Find(What:="*", _    SearchDirection:=xlPrevious, _    SearchOrder:=xlByColumns).Column

How to find the last cell with data on a worksheet:

On Error Resume NextdxLastCol= ActiveSheet.Cells.Find(What:="*", _    SearchDirection:=xlPrevious, _    SearchOrder:=xlByColumns).Column
dxLastRow= ActiveSheet.Cells.Find(What:="*", _    SearchDirection:=xlPrevious, _    SearchOrder:=xlByRows).Row
dxLastCell=cells(ldxLastRow,dxLastCol).address

', '





Subscribe

Main (RSS)

free-excel-help (RSS)

© 2000-2009 Dotxls.com