maybe i am missing something, the macro works ...and is searching for the last row in column A which is not empty and subtracts it from the cell A2.
use an macro error handler in your macro: (you may copy on your code the red line)
this error handler just ignores errors, but if there are still problems, we will use another one, if necessary...
Sub datesubs()
Dim lastrow As Long
Please keep in mind that the code works only when you enter data in any cell in this worksheet, not when you copy cells or expanding tables
With Sheets("Sheet1")
On Error Resume Next
lastrow = Range("A" & Rows.Count).End(xlUp).Row
Cells(2, 1).Value = Cells(lastrow, 1).Value - Cells(4, 1).Value
End With
End Sub