View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John[_88_] John[_88_] is offline
external usenet poster
 
Posts: 205
Default Cell update formula

Hi there,

If you want to do this for a single sheet, add the following to the specific
Sheet object (ie not a separate module):

Private Sub Worksheet_Change(ByVal Target As Range)
Dim iRow As Integer
iRow = Target.Row
Cells(iRow, 1).Value = Now()
End Sub


....or, if you want it to effect the whole workbook then add this to the
Workbook object:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim iRow As Integer
iRow = Target.Row
Cells(iRow, 1).Value = Now()
End Sub


Basically, when the change event fires 'Target' becomes a range from which
you can check the row number. You then use that in the cell address (Row x,
Column 1) to place the date and time.

Hope that helps.

Best regards

John

"CDDAH NHS" wrote in message
...
Hi

Does anyone know of a formula for Excel 2003 that will stamp the date &
time
in a particular cell if anything in that row has changed?

Many thanks

Neil