A countdown timer in an Excel spreadsheet could be helpful on a time-sensitive sheet, allowing the user to keep track of how much time they have left before a given event or deadline. While Excel doesn't have a countdown function or feature, you can use the built-in Visual Basic for Applications (VBA) programming language to create a countdown in a single Excel cell.
- Skill level:
- Moderately Challenging
Other People Are Reading
Open the Excel 2010 worksheet where you want to add a countdown timer. Right-click the cell where you want the timer to go and choose "Format Cells." Click "Custom" on the left side of the window that appears and then select "h:mm:ss" from the list on the right. Click "OK" to continue.
Hold down "Alt" and press "F11" to open up the VBA console. Select your current worksheet from the list on the left side of the console. Click the small arrow next to the "Insert Userform" button at the top of the screen, which is the second button from the left side, and choose "Module" from the list of options that appear. Double-click "Module 1" when it appears in the list.
Click the white space on the right side of the screen and enter the following code:
Dim Countdown As Date CountDown = Now + TimeValue("00:00:01") Application.OnTime Countdown, "Realcount"
This code will allow the rest of the code to process once each second.
Press enter to access a new line on the page. Enter to following code:
Dim count As Range Set count = [E1] count.Value = count.Value - TimeSerial(0, 0, 1) If count <= 0 Then MsgBox "Countdown complete." Exit Sub End If Call Countup
Change "E1" to whatever cell you want to use for the countdown. This code does the actual countdown and checks to see if the countdown is complete.
Click the "X" in the upper right corner of the console to close it.
Select the cell that you are using for your countdown and enter your desired countdown time. Be sure that you enter the hours, minutes and seconds, even if the hours and minutes are zero. "2:30" is two hours and thirty minutes; "0:2:30" is two minutes and thirty seconds.
Click the "Developer" tab at the top of the screen, and then click the "Macros" button on the left side of the ribbon. Select "Countup" from the list and click "Run." Your countdown will start and it will continue until it gets to zero, when you will see a message box explaining that the countdown is complete.
Tips and warnings
- If you want to make the numerical countdown bigger, you can select a number of cells, as long as your specified cell is in the upper left corner of the selection, and choose "Merge and Center" from the "Home" tab. Then change the font (from the home too), until the numbers are as large as you want them to be.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for