Countdown in status bar using VBA in Microsoft Excel

If you are wondering how can I create timer in excel

Question:

A count down from 30 to 0 seconds is to be displayed in the status bar.

Answer:
Insert the following code in the standard module.

Sub CountDown()
   Dim intCounter As Integer
   Dim bln As Boolean
   bln = Application.DisplayStatusBar
   Application.DisplayStatusBar = True
   For intCounter = 30 To 1 Step -1
      Application.StatusBar = intCounter & " Seconds..."
      Application.Wait Now + TimeSerial(0, 0, 1)
   Next intCounter
   Application.StatusBar = False
   Application.DisplayStatusBar = bln
End Sub

In this way you can use status bar to display excel vba timer.

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Visit Us On TwitterVisit Us On FacebookVisit Us On Google PlusVisit Us On Youtube