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
 

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
2,920
.
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
 

Jimmasterton

New Member
Joined
Mar 13, 2018
Messages
36
Thanks very much Logit, but I can’t download this workbook, can you post the instruction?
 

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
2,920
.

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:

Jimmasterton

New Member
Joined
Mar 13, 2018
Messages
36
Many thanks Logit! This works very well, i’d like range A1:F6 to flash with ‘Project Complete!’ at 00 hrs, is this doable?
 

Jimmasterton

New Member
Joined
Mar 13, 2018
Messages
36
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?
 

Forum statistics

Threads
1,081,615
Messages
5,360,037
Members
400,565
Latest member
Tommy O

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top