View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dominicb[_41_] dominicb[_41_] is offline
external usenet poster
 
Posts: 1
Default Enter current time into cell hh:mm:ss


Good evening rglasunow

You would be better off using the =NOW() function, the only problem
with this is that it will alter every time the sheet is recalculated.
The code below will call the NOW() function, format the cell
appropriately and then changes the cell contents from a formula to a
value.

Sub TimeStamp()
ActiveCell.FormulaR1C1 = "=NOW()"
With Selection
..NumberFormat = "h:mm:ss;@"
..Formula = .Value
End With
End Sub

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=382135