Macro to record date on sheet data is entered in a cell ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a macro to auto insert in an adjacent call the date data is entered in
a cell.
The following does not work because "Now" changes every day:
=IF(CK3<>"",NOW(),"")
 
This tiny macro looks for changes in column A and puts the date in the
corresponding row in column B:


Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
Target.Offset(0, 1) = Now
End Sub

This should be copied to worksheet code, not a standard module.
 
Here is some code that should do what you want... Paste this into the sheet
(right click the sheet tab and select view code). This code works on Cell CK3
but you can change it to whatever range you want...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("CK3")) Is Nothing Then _
Target.Offset(0, 1).Value = Now()
End Sub
 
Back
Top