VB Countdown

Eurekaonide

Active Member
Joined
Feb 1, 2010
Messages
422
Dear All

I would like to have a small box appear in the corner somewhere which is constantly counting down the days hours mins (sec if poss) to a certain date - I have seen this before but cannot seem to locate the code - I believe it was done VB as it sat on the desktop rather than in an excel but if I can only get it in Excel that would be fine.

I'm sure when I set it up you input what the date was you were aiming for and then it took the today date from the computer.

can anyone help at all please?

Many thanks
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Is this what you want?

Code:
Public TargetTime As Date

Sub InitMe()
TargetTime = Now + 10 / 24 / 60 / 60
Call TestTime
End Sub

Sub TestTime()
If Now() < TargetTime Then
   Application.StatusBar = "It is now " & Now()
   Application.OnTime Now + 1 / 24 / 60 / 60, "TestTime"
Else
   Application.StatusBar = False
End If

End Sub
 
Upvote 0
press Alt + F11, right click on your workbook and click insert module.

Copy the code, paste it in the new module (probably module 1). Press Alt + F4 to close the vba editor. Make sure to save the workbook as an xlsm (since the xlsx won't store the macro). Next, press Alt + F8 to run a macro, select the macro InitMe and press run.
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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