View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
zzxxcc zzxxcc is offline
external usenet poster
 
Posts: 27
Default Auto Refresh Time

I not an expert in reading these codes yet, so one simple question: How often
does this code refresh the data? And how do I set the refresh frequency to
ex. 1 sek or 1 minute?
--
Thanks


"Ardus Petus" wrote:

Paste the folllowing in a standard module:
'---------------------------------------
Option Explicit

Dim dTimer As Date

Sub initTimer()
Range("A1").Value = Now
dTimer = Now + TimeSerial(0, 0, 1)
Application.OnTime dTimer, "InitTimer"
End Sub

Sub stopTimer()
Application.OnTime dTimer, "InitTimer", , False
End Sub
'----------------------------------------

and the following in ThisWorkbook code:
'-------------------------------------------
Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
stopTimer
End Sub

Private Sub Workbook_Open()
initTimer
End Sub
'--------------------------------------------

HTH
--
AP


"klick_80" a écrit
dans le message de news:
...

Hey all, I want to have a running Time Stamp in Cell A1

I've tried =NOW() and once the time changes it doesn't update less I
save, and reopen. I know this is a very basic question, but i was told
it had to do with macros. If anyone knows, it would help me out greatly


--
klick_80
------------------------------------------------------------------------
klick_80's Profile:
http://www.excelforum.com/member.php...o&userid=36208
View this thread: http://www.excelforum.com/showthread...hreadid=559938