Identify Last Row using VBA Macros

     

  • User can find the last used cell i.e non Blank cell either in row or column
  •  

    Classification flow:

     

     

    In a Column we can find last row in two ways:

  • From Top to Bottom
  • From Bottom to Top
  •  

    In a Row we can find last Column in two ways:

  • From Left to Right Direction
  • From Right to Left Direction
  •  

    Click on the Image to watch video:

    Download The Workbook along with the Control Flow

     

    Sub Find_The_Last_Used_Cell_From_Top_to_Bottom()
    Dim R As Integer
    R = Range("A1").End(xlDown).Row
    MsgBox R
    End Sub

    Sub Find_The_Last_Used_Cell_From_Bottom_to_Top()
    Dim R As Integer
    R = Range("B" & Rows.Count).End(xlUp).Row
    MsgBox R
    End Sub

    Sub Find_The_Last_Column_From_Left_To_Right()
    Dim C As Integer
    C = Range("A2").End(xlToRight).Column
    MsgBox C
    End Sub

    Sub Find_The_Last_Column_From_Right_To_Left()
    Dim C As Integer
    C = Cells(3, Columns.Count).End(xlToLeft).Column
    MsgBox C
    End Sub