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

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(),"")
 
G

Guest

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.
 
G

Guest

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
 

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