View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.newusers
curlydave curlydave is offline
external usenet poster
 
Posts: 206
Default Need a excel formula which can see the second moving

Here's a VBA code Slightly modified from this site
http://www.mrexcel.com/forum/showthread.php?t=86297

Dim SchedRecalc As Date
Sub Clock()
Dim wbk As Workbook
Dim ws As Worksheet

Set wbk = ThisWorkbook
Set ws = wbk.Sheets("Sheet1")

ws.Range("A1").Value = Format(Now, "dd-mmm-yy")
ws.Range("B1").Value = Format(Time, "hh:mm:ss AM/PM")

Call SetTime
End Sub
Sub SetTime()
SchedRecalc = Now + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Clock"
End Sub

Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedu="Clock",
Schedule:=False
End Sub