Sub get_last_used_row()
' to get the last non-blank row
LastRow1 = Cells(Cells.Rows.Count, "A").End(xlUp).Row
'this is the keyboard equivalent of selecting a range using shift and down arrow
' Exercise What does "A" signify??
LastRow2 = UsedRange.Rows.Count
MsgBox "LastRow1 " & LastRow1
MsgBox "LastRow2 " & LastRow2
End Sub
Exercise - What is the difference between LastRow1 and LastRow2. Though they might give same results occasionally, the approach to get the last row is different. Find it out!
' to get the last non-blank row
LastRow1 = Cells(Cells.Rows.Count, "A").End(xlUp).Row
'this is the keyboard equivalent of selecting a range using shift and down arrow
' Exercise What does "A" signify??
LastRow2 = UsedRange.Rows.Count
MsgBox "LastRow1 " & LastRow1
MsgBox "LastRow2 " & LastRow2
End Sub
Exercise - What is the difference between LastRow1 and LastRow2. Though they might give same results occasionally, the approach to get the last row is different. Find it out!