I noticed today that if I enter information in a row below some data and then run my function to return the last row used, the function evaluates correctly. However, if I clear the data from column I am evaluating in Last Row function, the function includes that row that used to have data in it. I had to delete the row to get the function to return the true last row. What is the deal with this and how can I avoid it? Please find my code below. Thanks in advance for the help.
Code:
Public Function FindLastRow() As Long
Dim i As Long
'Searches in Column A.
i = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
FindLastRow = i
i = 0
End Function