Runtime error 1004
Application-defined or object-defined error
Runtime error 1004
Application-defined or object-defined error
Hmm. It works fine for me opened from the zip file. Unless you're doing something else (?) I have no idea what's causing that. Sorry!
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
I selected empty cell and pressed "Click_StopWatch" button, then I got this error.
Anyway, the idea is that you have one cell, call it "time_now", whose value is the current time. You then schedule a macro to update this cell every second, like this:
"SetTime" starts the timer, "Disable" stops it. "Recalc" will be run every second by the "Application.ontime" command and will update "time_now".![]()
Dim SchedRecalc As Date Sub SetTime() SchedRecalc = Now + TimeValue("00:00:01") Application.ontime SchedRecalc, "Recalc" End Sub Sub Recalc() Range("time_now").Value = Now Call SetTime End Sub Sub Disable() On Error Resume Next Application.ontime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False End Sub
Your macros to start and stop your 3 timers will now use formulae linked to "time_now", e.g.
=time_now-38977.6132315972
where 38977.6132315972 is the value of Now as I write this. Each time time_now is updated, all these formulae will also change.
C
Last edited by colofnature; 09-17-2006 at 09:50 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks