Hi CJR,
You didn't mention whether you are working in VBA, or want an Excel formula, and in addition what it means to find the bottom of the file. Do you want, for example, the row number of the last row on a worksheet that contains data? Or perhaps the last row that has data in a certain column? Or perhaps the last row that has cell formatting? Or perhaps some data in the last row, or an object reference to the last row? Can you be more specific?
Whatever the question, the answer is quite easy. For example, if you want a VBA function that returns the number of the last row that contains data in a particular column, use this function:
Function LastRow( CellRef as Range ) as Long
' Returns the last row containing data in the
' column containing cell CellRef.
LastRow = Cells(65536,CellRef.Column).End(xlUp).Row
End Function
To use this function in Excel, enter the formula:
=LastRow(B1)
where B1 is provided to tell LastRow that you want it to find the last row containing data in column B.
Happy computing.
Damon