Friday, 4 November 2016

Find the last Row and last column in Excel

In this post we are going to see how to find out the Last Row and Last Column in a Excel sheet. this will be helpful in many situations.



            Dim LastRow As Long
            Dim lastCol As Long
            
            
            lastCol = ProBook.Worksheets(1).Cells(1, Columns.Count).End(xlToLeft).Column
                   
            LastRow = ProBook.Worksheets(1).Cells.Find(What:="*", _
                       After:=ProBook.Worksheets(1).Cells.Range("A1"), _
                       SearchDirection:=xlPrevious, _
                       LookIn:=xlFormulas, _
                       SearchOrder:=xlByRows).Row







From this post you can learn how to find the Last Row and Last column in a Excel sheet

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete