Ira,
Name a cell TimeToGo, and in that cell enter the formula (watch line wrapping)
=IF(NOW()<TargetDate,INT(TargetDate-NOW()) & " days, " & TEXT(((TargetDate-NOW()) -
INT(TargetDate-NOW())),"hh:mm:ss"),"Done!")
Name another cell TargetDate, and in that cell either use a formula to calculate or directly enter
the Date/Time that you want to countdown to.
Then run StartIt and run StopIt if you want to stop the timer.
HTH,
Bernie
MS Excel MVP
Dim NextTime As Date
Public Running As Boolean
Sub StartIt()
Running = True
Update
End Sub
Sub Update()
NextTime = Time + TimeValue("00:00:01")
If Range("TimeToGo").Value <> "Done!" Then
Range("TimeToGo").Calculate
Application.OnTime NextTime, "Update"
End If
End Sub
Sub StopIt()
If Not Running Then Exit Sub
On Error Resume Next
Application.OnTime NextTime, "Update", schedule:=False
Running = False
End Sub