Info from
http://msdn.microsoft.com/en-us/library/aa139976%28v=office.10%29.aspx.
It deals with VBA, but it may help you here.
It is an old reference, but in this respect valid.
Look under
Last Cell.
In particular,
"The last cell is considered to be the intersection of the highest numbered row in the worksheet that contains information and the highest numbered column in the worksheet that contains information. Excel also includes cells that have contained information during the current session, even if you have deleted that information. The last cell is not reset until you save the worksheet.
Excel considers formatted cells and unlocked cells to contain information. As a result, you will often find the last cell well beyond the region containing data, especially if the workbook has been imported from another spreadsheet application, such as Lotus 1-2-3. If you want to consider only cells that contain data in the form of numbers, text, and formulas, you can use the following code:
Sub GetRealLastCell()
Dim lRealLastRow As Long
Dim lRealLastColumn As Long
Range("A1").Select
On Error Resume Next
lRealLastRow = Cells.Find("*", Range("A1"), xlFormulas, , xlByRows, _
xlPrevious).Row
lRealLastColumn = Cells.Find ("*",Range("A1"), xlFormulas, , _
xlByColumns, xlPrevious).Column
Cells(lRealLastRow, lRealLastColumn).Select
End Sub
"
See also this.