Thread: Refesh time
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Refesh time

Add this procedures

Public nTime as double

Public Sub ShowTime()
Worksheets("Sheet1").Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "ShowTime"
End Sub

and run it.

You need to stop it also

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime ntime, "ShowTime", , False
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Lorri" wrote in message
...
Is there anyway to have an excel file up and have it automatically refresh
the file so that the time gets updated every minute?
Thanks
Lorri