Getting current time into cell as a static value

W

wadefleming

I want to get the current time into a cell either by clicking in the
cell or clicking a pushbutton.

Kind of like using =NOW() but once the value should not change after it
is initially set.

A bit like using Ctrl-Colon but as the spreadsheet will be run on a PDA
it needs to be activated by clicking in the cell or a pushbutton.

Thanks
 
G

Gord Dibben

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM")
End Sub

OR a sheet event that would place the static time in a cell when a cell is
double-clicked.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As _
Boolean)
ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM")
End Sub


Gord Dibben Excel MVP
 
Top