ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Refresh Time (https://www.excelbanter.com/excel-programming/366763-auto-refresh-time.html)

klick_80[_3_]

Auto Refresh Time
 

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
save, and reopen. I know this is a very basic question, but i was tol
it had to do with macros. If anyone knows, it would help me out greatl

--
klick_8
-----------------------------------------------------------------------
klick_80's Profile: http://www.excelforum.com/member.php...fo&userid=3620
View this thread: http://www.excelforum.com/showthread.php?threadid=55993


zzxxcc

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





zzxxcc

Auto Refresh Time
 
Sorry, I can get this code to work. Nothing happens. I have put the code in
the two different places: Module 1 and This workbok. What's wrong?
--
Thanks


"zzxxcc" wrote:

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





Tom Hutchins

Auto Refresh Time
 
I have a workbook created by Bob Phillips which is a demo of exactly the kind
of continuous background time display you describe. It uses API calls.
Unforunately, I don't remember the URL where I downloaded it. The file's name
is "Interactive Clock v5.1.xls" Bob Phillips is a big name on these forums,
so it may not be hard to find his website & and the file. Otherwise, I am
happy to e-mail it to you.

Regards,

Hutch

"klick_80" wrote:


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




All times are GMT +1. The time now is 03:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com