PDA

View Full Version : =today(),now()



kamalmalek
01-29-2012, 11:54 AM
dear experts,
i have column "Locked" ,when user update his data in other column direct give me date/time he updated by this function:
=IF(ISTEXT(B2),TODAY(),"")
OR
=IF(ISTEXT(B2),NOW(),"")

the problem for me :any time openning the file: update me time and date "NOW"
What is the function to to keep the date/time of the user he updated "Not the date/time NOW!!!!!"
thanks in advance,

mdmackillop
01-29-2012, 01:53 PM
Put this in the worksheet module. This will update a corresponding cell if a value in Column B is changed
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Or Target.Cells.Count > 1 Then Exit Sub
Target.Offset(, 2) = Now
End Sub