View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Update date & time in a cell only when worksheet is changed

Hi,

You need code for that. ALT+F11 to open VB editor. Double click
'ThisWorkbook and paste the code below in on the right. Change the cell to
the one you want

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.EnableEvents = False
ActiveSheet.Range("A1").Value = Now
Application.EnableEvents = True
End Sub

Mike

"RJD" wrote:

I have a workbook with multiple worksheets. I'd like to have the time & date
in a cell in each worksheet update only when information in that worksheet is
changed. I don't change each worksheet each time I use the workbook. I tried
=NOW(), but it changes the time and date in each worksheet.