Countdown to an event?

Jimmasterton

New Member
Joined
Mar 13, 2018
Messages
36
Hi experts
I need some help please. I’m trying to make a countdown timer to the launch of a project. I want it to countdown DD:HH:MM:SS. I would like to put the event date in vba so that all you see when you open the workbook is a small ‘clock’ in the top corner of the screen.

I’ve got a ‘no ribbon’ minimal window set up already, but is it possible for the vba to know when to start the countdown again from after I close and open the workbook ? This timer will opened and closed frequently by multiple users.

Perhaps when the countdown reaches 00:00:00:00 a flashing “Project Launch!!”

Thanks guys
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
.
Paste into a Module :

Code:
Option Explicit


Public bTimerOn As Boolean


Sub ToggleTimer() ' This Sub will switch the automatic timer on if it was off before, and vice-versa
bTimerOn = Not bTimerOn


Refresh ' It calls the Refresh Sub
End Sub


Sub Refresh() ' This Sub calculates the sheet and tells Excel to call it again after 1 second
Application.Calculate


If bTimerOn Then ' If bTimerOn is True, start refreshing automatically
Application.OnTime Now + TimeValue("00:00:01"), "Refresh" ' The intervall is set to 1 second but can be changed variably
End If
End Sub

Download workbook : https://www.amazon.com/clouddrive/share/Y2aUfh2NfW2NpmPZ2FUms5y5xfnuye0GYU23PXPT8MV
 
Upvote 0
.

A
B
C
D
E
F
1
Target Time
12/3/2018 16:30
2
Years
Months
Days
Hrs / Min /Sec
3
Remaining Time
00
2
16
5:21:14
4
Formula in C3:F3 =C1-Now()
5
6
C1 : Custom Format m/d/yyyy hh:mm
7
C3: Custom Format yy
8
D3: Custom Format m
9
E3: Custom Format d
10
F3: Custom Format h:mm:ss




In addition to the macro in my Post #2 (which goes in a Module), this macro goes in ThisWorkbook Module :

Code:
Option Explicit


Private Sub Workbook_Open()
    ToggleTimer
End Sub

You can choose to insert a Command Button on the worksheet that would be connected to the macro named "ToggleTimer". This would give you the ability
to turn off the timer if you want while the workbook is open. It is not necessary to have this button though. When the workbook is opened, the timer auto-starts.
 
Last edited:
Upvote 0
Many thanks Logit! This works very well, i’d like range A1:F6 to flash with ‘Project Complete!’ at 00 hrs, is this doable?
 
Upvote 0
I’m trying to display a message box when the countdown completely zeros. I’m having difficulty referencing the cell so I can userform.show. The cell zeros then goes to lots of #####, can anyone help?
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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