Countdown not running properly

Yorkie

Board Regular
Joined
May 6, 2003
Messages
138
I have some coding that does a countdown, however, it does the first second then doesn't show the countdown from then on. It only counts down when I close down and open again....not that helpful!!!

Is there a way to keep the countdown running? (I know it is running in the background).

Here is some of the code I am using.

Code below:

Sub sheet_calc()
dt = 1 / 24 / 60 / 60
t = Range("d27").Value
If t > -dt Then
Application.OnTime Now + TimeValue("00:00:01"), "sheet_calc"
If t < dt Then Application.Speech.Speak "Warning. warning. warning. warning. warning"

ActiveSheet.Calculate
End If
End Sub

_____________________________________________________________
Private Sub CommandButton1_Click()
Range("N2").Value = Now
End Sub
__________________________________________________________________
In cell Q1 I have this formula

=N1+P1-NOW()

Cell N1 has the date and time in this format: dd/mm/yyyy h:mm
___________________________________________________________________
And I have 2 macros that has this:

Macro 1:

Range("P1").Select

ActiveCell.FormulaR1C1 = "12:01:00 AM"
Range("P2").Select
___________________________________________________________________
Macro 2:

Application.Run "timer.xltm!sheet_calc"


Very messy I know, is there a better way?

Thanks.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,819
Messages
6,121,749
Members
449,050
Latest member
excelknuckles

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