Thread: Time Stamp help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul Paul is offline
external usenet poster
 
Posts: 661
Default Time Stamp help

Gerard

Make your first line something like this

if ActiveSheet.Name = Format(dateTemp, "MMM dd.hh.mm.ss") then exit sub


"Gerard Sanchez" wrote:

Hi,

Currently I we have this VBA code that puts in the date and time
of last edit of the worksheet:


Private Sub Worksheet_Change(ByVal Target As Range)

Dim dateTemp As Date

ActiveSheet.Names.Add Name:="_timestamp", RefersTo:=Now()
dateTemp = Val(Mid(ActiveSheet.Names("_timestamp"), 2))

ActiveSheet.Name = Format(dateTemp, "MMM dd.hh.mm.ss")

End Sub


I am wonder if anyone can revise this so that when current Date
is returned the code dies; any changes made subsequently to the
worksheet the following day wouldn't change its value??



.