I need a formula (not VBA) that will return the row number of the last used cell in a worksheet.
I have data like:
Not all columns have data and the columns are not filled with the same number of rows.
If I was dealing with only a single column (say column F), I would use:
which yields 13, but the data spans many columns in Sheet1
If I could use VBA rather than a formula, I would use something like:
Sub GetLastRow() Dim LastRow As Long, rng As Range Set rng = Sheets("Sheet1").Cells LastRow = rng.Find(what:="*", after:=rng(1), searchdirection:=xlPrevious).Row MsgBox LastRow End Sub
I think I am missing something very simple.