excel: subtract updated time from earilier

B

Boswell

Earilier Base, (on-updating) - Updating time ?

As example; open prgm...enter 9:00, close.

Return, (at say 9:45) time arith. [a4-a3]; would find the diff. between the
UPDATED time, (9:45), and unchanged entry, (9:00).
 
S

ShaneDevenshire

Hi,

I'm not entirely sure what you want but here is a guess:

Suppose cell A3 contains the last updated time manually entered and you want
to return 45 minutes later and enter the new time in A3 and have A4 show the
difference between the two, then you will need VBA, here is a routine to do
this for the above mentioned cells on sheet1.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("A3"))
If Not isect Is Nothing Then
Range("A4") = Range("A3") - Range("A5")
Range("A5") = Range("A3")
End If
End Sub

Format cell A4 to a time format like [h]:mm:ss Cell A5 will keep track of
the last value in cell A3 so you need to leave it alone. You can use another
cell, it doesn't matter where the cells are. This is just a working sample.


If this helps, please click the Yes button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top