Aussie
Automatically when you select a particular cell would require event code like
this....
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Address = "$B$3" Then
Target.Value = Format(Now(), "h:mm:ss AM/PM")
End If
enditall:
Application.EnableEvents = True
End Sub
To insert the time in the active cell use this macro assigned to a button.
Sub NOWTIME()
ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM")
End Sub
Gord Dibben Excel MVP
On Tue, 14 Jun 2005 01:09:01 -0700, "AussieAVguy"
wrote:
I need to be able to have excel insert the current time including seconds
into a cell. I've tried the Now() function but it keeps updating everytime
the spreadsheet recalculates. The shortcut ctrl+shift+; doesn't give seconds
and I'd prefer it to happen automaticly.
Anyone??
|