excell worksheets

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

Guest

How can I date stamp a cell entry that will not up-date until the entry is
changed?
 
I have made a spead sheet to enter statistical data into many cells. I want
to see the actual date of entry in another set of cells. Problem is that
everything I have tried up-dates the date cells to today's date each time I
open the spread sheet. I do not want to depend on the person entering the
data to also manually enter the date.
 
Right click sheet tab>view code>insert this>save workbook
now when you change anything in cells d2: d22 the date will be put in col F

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("d2:d22")) Is Nothing Then
Target.Offset(0, 2) = Date
End If
End Sub
 
BillyBob

You will need event code for this.

When entering data in A1:A10, the date will be placed in column B

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
If .Value <> "" Then
.Offset(0, 1).Value = Format(Now, "dd mmm yyyy")
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the above into that sheet module.

Adjust range to suit.


Gord Dibben MS Excel MVP
 
Thank you. This worked quite well.

Don Guillett said:
Right click sheet tab>view code>insert this>save workbook
now when you change anything in cells d2: d22 the date will be put in col F

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("d2:d22")) Is Nothing Then
Target.Offset(0, 2) = Date
End If
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

Back
Top