PDA

View Full Version : Solved: Digital clock within worksheet needed



macro_man
04-03-2009, 08:10 AM
I have a very strict morning routine that I have set up in Excel that allocates the morning's time for each task before I leave for work. I would like to have a digital clock displayed on the same worksheet as the schedule to monitor my progress. I have downloaded clocks that display on the desktop but would prefer it be on the Excel worksheet. I can put in =now() and set up a looping macro to continuous calculate the cell, but that seems like it would not be good for the computer system. Is there a better way?

In a separate macro would there be a way to prompt a sound whenever a task should be complete so I can move onto the next one.

Each task is set up with a start time and and end time based on the number of minutes allocated for each one such as ...

4:50AM - 5:05AM 20 (minutes) ... lift weights
5:06AM - 5:21AM 15 (minutes) ... shower

Thanks for any assistance you may provide. This is a great site!

Dr.K
04-03-2009, 09:03 AM
Well... Modeless forms run async, so you could build a series of simple loops in your form like:

Do
DoEvents
Loop Until Now >= constTime1
'beep, play WAV sound, a msgbox, whatever notification you want


Do
DoEvents
Loop Until Now >= constTime2
'beep, play WAV sound, a msgbox, whatever notification you want

This shouldn't eat up too much resources.

macro_man
04-22-2009, 08:23 AM
I ended up solving this myself with the help of the following link. I used a section of the code that creates this clock (I converted mine to digital).

http://spreadsheetpage.com/index.php/file/analog_clock_chart/

jolivanes
04-22-2009, 02:16 PM
Here are a couple more if so needed.

http://www.tushar-mehta.com/excel/software/clocks/digital_clock.htm (http://www.tushar-mehta.com/excel/software/clocks/digital_clock.htm)
http://www.xcelfiles.com/VBA_Clock.html (http://www.xcelfiles.com/VBA_Clock.html)

HTH