View Single Post
 
Old 08-16-2011, 04:25 AM
Catalin.B Catalin.B is offline Windows Vista Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

paste these macros in a module (change worksheet name as needed.)

Sub auto_open()
' works when you double click a cell and press enter, not when formula result changes, or when you copy formula to range
' whenever you need to update , double click on any cell then press enter
ThisWorkbook.Worksheets("Foaie2").OnEntry = "datesubs"

End Sub

Sub datesubs()
Dim lastrow As Long

With Sheets("Foaie2")
lastrow = Range("A" & Rows.Count).End(xlUp).Row
Cells(1, 1).Value = Cells(lastrow, 1).Value - Cells(2, 1).Value

End With
End Sub
Reply With Quote