Thread: Time
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Time

CTRL + SHIFT + semi-colon will enter a staic time in a cell.

Another method would require event code to enter the static time when an event
takes place like a double-click on any cell.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
With Target
.Value = Format(Now, "hh:mm:ss")
End With
Cancel = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste into the module that opens.

If you prefer this to operate on just one column use the code below which will
enter the time into column A cells only...........

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
If Target.Cells.Column = 1 Then
With Target
.Value = Format(Now, "hh:mm:ss")
End With
End If
Cancel = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 11 Sep 2007 09:28:06 -0700, jacksonsgurl
wrote:

How do you get a cell ixed to where you can click on it and the current time
automatically comes up and does not continue to follow the time clock after
you have selected the cell and clicked off of it? I am trying to make a
dispatch sheet for when my rescue squad has a call at a fair that we provide
support for. Any help anyone can give me would be great.