Active Clock

richblake74

Active Member
Joined
Dec 30, 2006
Messages
284
Office Version
  1. 365
Platform
  1. MacOS
Is there anyway of getting an "Active Clock" in a cell.
I know the =now() thing, but this is not what I am looking for,
I would like to get a clock that updates by the minute, without having to select a cell, or make excel do a calculation.
Hope you are all having fun with excel 2007
richblake74 :rolleyes:
 
Try

Code:
Range("U2").Value = Now() - Date

and make sure U2 is formatted as Time. But Right_Click's code is much better.
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Tom,

Looks to me like this does fire up the CPU a bit. On my machine if Excel has focus, it looks like the CPU burns at between 60% & 80% of capacity and if Excel does not have focus it hums along using about 20% of capacity.

Interesting the jump in CPU usage when Excel gets focus. Any ideas on why that would be?

Just curious,
 
Upvote 0
I don't know Greg. Running the Resource Monitor on Vista, there was no jump in CPU or memory. I lowered the firing time from 1000 to 5 milliseconds and there was a neglible jump from 1.15 to 1.28. Is there another process I should be looking at? I suppose that you are speaking of the "Excel" process?
 
Upvote 0
This code fired it up to 49.12
Sub sdfsdf()
Do: DoEvents: Loop
End Sub

Application.OnTime Now + TimeSerial(1, 0, 0), "Hi"

Placed it at 1.88
 
Upvote 0
strange behaviour :confused:

I quoted out lines with "caption" and "Range", but cell A1 as well as the caption are still updating :unsure:
Code:
Sub Tick(ByVal dwParamOrCancel As Long, ByVal hwnd As Long, ByVal Milliseconds As Long, ByVal nEventId As Long)
    On Error Resume Next
    'Application.Caption = Now
    Application.StatusBar = Now
    'Range("A1").Value = Now
End Sub

What am I missing here ??

best regards,
Erik
 
Upvote 0
Erik. Stop the timer before you edit the code. I don't know much about the internals, but I suppose that addressof locks the compiler out until it is released by KillTimer.
 
Upvote 0
Thank you for your answer, Tom.
I should have told explicitly, that I restarted Excel to check it out: even then the application.caption and the cell were updating.

Now after some hours, restarted computer: still same problem??? Very strange isn't it?

In fact the caption is displaying the date & time AND the name of active workbook!!

(Office XP, Windows 98SE)
 
Upvote 0
Sounds like you have an extra excel.exe running. Well... Two is better than one. Right? :)
 
Upvote 0

Forum statistics

Threads
1,216,082
Messages
6,128,707
Members
449,464
Latest member
againofsoul

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top