View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default How do I have a cell display the date its row was last updated?

How to insert code into worksheets:
http://www.jlathamsite.com/Teach/WorksheetCode.htm

Just change "A" to whatever column the date should be placed into on the
current sheet/row where a change was made.

If you need this on several sheets, each worksheet needs this code added to
it's _Change() event.

Private Sub Worksheet_Change(ByVal Target As Range)
Const DateCellColumn = "A" ' change
If Target.Cells.Count 1 Then
Exit Sub
End If

Application.EnableEvents = False
Range(DateCellColumn & Target.Row) = Now()
Application.EnableEvents = True

End SubHow to insert code into worksheets:
http://www.jlathamsite.com/Teach/WorksheetCode.htm

Just change "A" to whatever column the date should be placed into on the
current sheet/row where a change was made.

If you need this on several sheets, each worksheet needs this code added to
it's _Change() event.

Private Sub Worksheet_Change(ByVal Target As Range)
Const DateCellColumn = "A" ' change
If Target.Cells.Count 1 Then
Exit Sub
End If

Application.EnableEvents = False
Range(DateCellColumn & Target.Row) = Now()
Application.EnableEvents = True

End Sub

"castell" wrote:

Hiya,
does anyone know how to have a cell automatically display adate that is
refreshed to today whenever its row is updated? - would be massively useful...

many thanks!