laitimes

How to make a quiz countdown timer with Excel? Excel makes a quiz countdown timer

author:Snow plum plum blossoms

<h1 class="pgc-h-arrow-right" > Excel to make a quiz countdown timer</h1>

Original Excel and Python Practical Office Programming Skills 2019-12-23

A few days ago, the unit was engaged in the New Year celebration, there was a link in the middle of which was a prize quiz, when the head of the conference team asked me to control the quiz timing, and at that time I made a quiz countdown timer with Excel.

How to make a quiz countdown timer with Excel? Excel makes a quiz countdown timer

So, how to make a quiz countdown timer in Excel?

Today, Xiaobai will use Excel's VBA programming to demonstrate to everyone!

Step 1: Make a countdown timer display interface

Mainly to make the start and stop buttons of the countdown timer, the countdown length setting, and the countdown display.

(1) Click "Development Tools" to enter the design mode and insert the button

How to make a quiz countdown timer with Excel? Excel makes a quiz countdown timer

(2) Add a countdown length setting display item

How to make a quiz countdown timer with Excel? Excel makes a quiz countdown timer

(3) Add a countdown display item

How to make a quiz countdown timer with Excel? Excel makes a quiz countdown timer

Step 2: Write the countdown timing sub-process module

(1) Define the countdown "Start" and "Stop" flag global variables

Public flag As Integer

(2) Define the countdown duration global variable

Public count As Integer

(3) VBA write countdown timing sub-process module

Sub Time_count()

If flag = 1 Then

ThisWorkbook.Sheets(1). Range("G6") = count

count = count - 1

If count = 0 Then

flag = 0

End If

DoEvents

Application.OnTime Now() + TimeValue("00:00:1"), "Time_count"

End Sub

Step 3: Write "Start" and "Stop" key events

(1) "Start" key event (countdown timing sub-process module called: Time_count)

Private Sub CommandButton1_Click()

flag = 1

count = Range("I4"). Value

Time_count

(2) "Stop" key event

Private Sub CommandButton2_Click()

ThisWorkbook.Sheets(1). Range("G6") = 0

The above is the method of using Excel to implement the quiz countdown timer, and the specific VBA code is given below for everyone to communicate!

How to make a quiz countdown timer with Excel? Excel makes a quiz countdown timer

Follow our public account "Practical Office Programming Skills" (WeChat: Excel-Python) to make our work and life changes easier.

How to make a quiz countdown timer with Excel? Excel makes a quiz countdown timer

Past Articles:

0. Countdown with Excel how many days there are still for the Chinese New Year

1. Make an automatic lottery with Excel

2. How to write an Excel function by yourself and call it?

3. Excel plays with dynamic lookup information tables

4. Easily get VBA programming for Excel

5. Use Excel to send personalized emails in bulk

6. Play with several high-frequency usage functions of Excel (7)

7. Play with several high-frequency usage functions of Excel (6)

8. Play with several high-frequency usage functions of Excel (5)

9. Play with excel's several high-frequency usage functions (4)

10. Play with several high-frequency usage functions of Excel (3)

11. Play with several high-frequency usage functions of Excel (2)

12. Play with several high-frequency usage functions of Excel (1)

Read on