G
Guest
I want to insert a function into a cell that displays the date another cell
was modified. How can I do this?
was modified. How can I do this?
Bernie Deitrick said:j,
The following will put the record on the same row, but 4 columns over,
recording any changes to the block of cells A1100. (So the records are
written in E1:H100)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
If Not Intersect(Target, Range("A1100")) Is Nothing Then
Application.EnableEvents = False
For Each myCell In Intersect(Target, Range("A1100"))
myCell.Offset(0, 4).Value = "Cell " & _
myCell.Address(False, False) & " was changed " & _
Format(Now(), "mmm dd, yyyy at hh:mm:ss")
Next myCell
Application.EnableEvents = True
End If
End Sub
HTH,
Bernie
MS Excel MVP
Dave
If you change W5 or CB5 I need a date to be populate in CE5.
If you change any cell in A5:cb3000 i need the date to appear in the row
that has changed in colum CE
In other words any change on any row between column A and column CB needs to
generate a date to be populated in column CE on the row that has changed.
In the W:CB range I need the colour of the cell that has been changed to
change colour - hence the range in the macro below.
Does this make sense?
No for each row that has a change in it I want to capture the date on that
row in CE. I like the idea of the time as well as date too.
Sorry Dave sent that off in a hurry, it does what I want for populating the
date. I also need the cell colour of the cell I have changed to change
colour. Is that possible?
Thanks again for all your help
Dave
I had this one (below) that was working but when I try to put either it or
the one you just sent me in with the macro you gave me that puts in the date
neither macro works. Is there a way for them both to work?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("w5:CB3146"))
If Not isect Is Nothing Then
Target.Interior.ColorIndex = 3
End If
End Sub
Dave
I had this one (below) that was working but when I try to put either it or
the one you just sent me in with the macro you gave me that puts in the date
neither macro works. Is there a way for them both to work?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("w5:CB3146"))
If Not isect Is Nothing Then
Target.Interior.ColorIndex = 3
End If
End Sub