- Get link
- X
- Other Apps
Featured Post
- Get link
- X
- Other Apps
With few lines of VBA it is easy to make a count down counter or timer. You can make count up or down counter by using while or for and with optimized delay code. Checkout the tutorial and code for designing counters in excel. Just create a button and copy code.
Copy and paste below code in your excel file.
Sub AddDelay()
Dim time1, time2
time1 = Now
time2 = Now + TimeValue("0:00:01")
Do Until time1 >= time2
DoEvents
time1 = Now()
Loop
End Sub
Private Sub CommandButton1_Click()
Dim a As Integer
a = Worksheets("Sheet1").Cells(3, 2)
While a > -1
Worksheets("Sheet1").Cells(4, 2) = a
AddDelay
a = a - 1
Wend
End Sub
Comments
Post a Comment