This function will return the first blank row that comes after any other data on the worksheet sent to it as a parameter.
Code
Function firstUnusedCellRowNumber(sh As Worksheet) As Long
With sh.UsedRange
If .Cells(1, 1).Address <> .Cells(.Rows.Count, .Columns.Count).Address Then
firstUnusedCellRowNumber = .Rows.Count + .Row
Else
If .Cells(1, 1).Value <> "" Then
firstUnusedCellRowNumber = .Row + 1
Else
firstUnusedCellRowNumber = 1
End If
End If
End With
End Function
Display More
A call to it might be something like this to get the cell in column A:
If the worksheet is empty, the function returns row 1. If the last of the data is in B13, the function returns row 14. If everything is blank except for row 13, it still returns 14.
This can be helpful if you would rather use
but you aren't sure which column has the last row of data.