Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A custom solution from Bob will probably be the least work for you. But,
here's something that could keep you going in the meantime. For the countdown timer (and for one possible approach to a real time clock): Clocks http://www.tushar-mehta.com/excel/so...cks/index.html To implement your own real time clock in an Excel cell, you can do the following: Add the following code to a standard code module: Option Explicit Dim NextTime As Date Sub RepeatOneSec() Application.Calculate NextTime = Now() + TimeSerial(0, 0, 1) Application.OnTime NextTime, "RepeatOneSec" End Sub Sub EndProcess() Application.OnTime NextTime, "RepeatOneSec", , False End Sub [For more on the rationale behind the above code see How can I make a cell (or some other object) flash? http://www.tmehta.com/tmxl/dbfind_byid.asp?id=14] Now, in any cell, enter =NOW() and format it to show the time as desired. Initiate the above code by running the RepeatOneSec procedure. This will recalculate your application every second (yes, that can have consequences) and in the process the cell with the NOW formula will update. To stop the clock, run the EndProcess procedure. To implement the step functions you want, in some cell, say C15, enter the starting time reference (including the date). For more on how, see the XL help topic 'Insert the current date and time in a cell' Now, in some cell, say E15, enter the formula =MINUTE(NOW()-C15). This will give you the elapsed time in minutes since the base date+time in C15. You can use this as a trigger for whatever you want. For example, in some cell, enter the formula =IF(E1510,50,IF(E155,20,10)) In article om, says... Hi! I'm new to Excel and I want to do something that seems to be pretty complicated (for me)! I want to insert a clock onto a sheet and have it update in real time when I start the program. It also then needs to count down for a given period of time. Also, I want it to update two other variables which would be defined dependant upon how much time has elapsed. For example it goes from 10 to 20 after 5 minutes, 20 to 50 after 10, and so on. Is there any easy way for me to do this? I'm a bit of a newbie to the more complicated features of Excel but I understand Macros a bit so some steps in the right direction would be a great help. Thanks for all your advice in advance. MATT -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sharing spreadsheet between two computers real-time? | Excel Discussion (Misc queries) | |||
Real time clock | Excel Discussion (Misc queries) | |||
REAL TIME CLOCK | Excel Discussion (Misc queries) | |||
Real-time clock in excel | Excel Discussion (Misc queries) | |||
how do i insert a real time clock in excel ? | Excel Discussion (Misc queries) |