• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Record Current date without changing

Injinia

Member
Hi,


I have a table with a date column on column B7:B13. I have tried using the formula =IF(H7<>"";TODAY();"") but the date updates whenever I open the table on a different date.


How would I get the date to be set such that, whenever I input data into column H, column B on the same row, updates the current date (time stamp of soughts), and on the following day, does not re-update same cell to the new date?


-Injinia
 
Use event code in the worksheet code module

[pre]
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit

Application.EnableEvents = False

If Target.Column = 8 Then

If Target.Value <> "" Then

Me.Cells(Target.Row, "B").Value = Date
Me.Cells(Target.Row, "B").NumberFormat = "dd mmm yyyy"
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub
[/pre]
 
Back
Top