How to Create Timer-Counter Using Excel VBA

Our Excel training videos on KZread cover formulas, functions and VBA. Useful for beginners as well as advanced learners. New upload every Thursday.
For details you can visit our website:
www.exceltrainingvideos.com/h...
The idea of this video is not only to learn how to create a timer that doubles as a counter but also to learn some more interesting features and benefits of Excel VBA for automation.
For more knowledge read the book Excel 2016 Power Programming with VBA: amzn.to/2kDP35V
If you are from India you can get this book here: amzn.to/2jzJGqU

Пікірлер: 88

  • @Killy369
    @Killy3698 жыл бұрын

    MUCHAS GRACIAS! excelente video muy bien explicado

  • @Exceltrainingvideos
    @Exceltrainingvideos11 жыл бұрын

    Thanks for motivating!

  • @RaghavaShine
    @RaghavaShine9 жыл бұрын

    Thank you for the VBA class, it was very useful, Keep doing... All the Best

  • @1973rugger
    @1973rugger11 жыл бұрын

    Thank you. Very well done.

  • @Testing_QualityAnalyst_Channel
    @Testing_QualityAnalyst_Channel8 жыл бұрын

    Thankyou Dinesh Sir your videos are very useful for me

  • @Exceltrainingvideos
    @Exceltrainingvideos11 жыл бұрын

    You can try for example: Range("A1").NumberFormat = "[h]:mm:ss.000" This would format Range("A1") in the required way. Note for the milliseconds a '.' is used!

  • @powerluke7368
    @powerluke73688 жыл бұрын

    Thank You !!!!!!

  • @mallemang
    @mallemang11 жыл бұрын

    excellent job..thanks

  • @nadiaregli6522
    @nadiaregli65229 жыл бұрын

    Loved the video and help me so much! Thankyou Dinesh!

  • @nadiaregli6522

    @nadiaregli6522

    9 жыл бұрын

    helped*

  • @jastak
    @jastak10 жыл бұрын

    excellent video!

  • @wikimoc
    @wikimoc9 жыл бұрын

    Thanks a lot Dinesh

  • @edwin60590
    @edwin6059011 жыл бұрын

    thank you so much....

  • @akshaydey6143
    @akshaydey61436 жыл бұрын

    wow.. i like this.. most simplest code used ...

  • @edwin60590
    @edwin6059011 жыл бұрын

    thanks alot for the algorithm

  • @Cadrieldur
    @Cadrieldur8 жыл бұрын

    Thank you so much for the simplicity of the video.

  • @mohamedhassn9652
    @mohamedhassn96526 жыл бұрын

    thanks for your effort i'd like to know how to make elapsed time from timer-counter - on working

  • @venugopalb8181
    @venugopalb81817 жыл бұрын

    Hi Sir, Thanks for helping us with simplified codes. Could you please help me on how to make real time Analog clock in user form with VBA code. (which contains Hours, Minutes and Seconds hand)

  • @mcelearr
    @mcelearr8 жыл бұрын

    Cheers buddy :)

  • @bhp3735
    @bhp37354 жыл бұрын

    좋은 영상 감사합니다.

  • @Exceltrainingvideos

    @Exceltrainingvideos

    4 жыл бұрын

    Welcome! Please share with your friends.

  • @learnshare
    @learnshare11 жыл бұрын

    Thank's ;-)

  • @EleazarCrucesOchoa
    @EleazarCrucesOchoa7 жыл бұрын

    Muy bueno, Very good.

  • @Exceltrainingvideos

    @Exceltrainingvideos

    7 жыл бұрын

    Glad that you found the video useful.

  • @MyQuimo
    @MyQuimo10 жыл бұрын

    hi Dinesh, Do you have video for the decrement count, I will enter a time that he will count backward until zero.

  • @Exceltrainingvideos
    @Exceltrainingvideos11 жыл бұрын

    Did you use Schedule: =False?

  • @tihenry2k
    @tihenry2k11 жыл бұрын

    You did a great job with ur program....please I would like you to help me. I made a program using your codes but I would like to add the milliseconds on it..I would be very happy if you explain me how to do it basing on your code...Thank you

  • @jay55patel
    @jay55patel8 жыл бұрын

    thank you very nice

  • @Exceltrainingvideos

    @Exceltrainingvideos

    8 жыл бұрын

    +Jay Patel Glad that you found the video useful.

  • @shaharle88
    @shaharle889 жыл бұрын

    Hi Dinesh Is it possible to make code that you can move between sheets with timer?

  • @missokae32
    @missokae327 жыл бұрын

    Good Day! Mr.Dinesh Kumar Takyar Your video is very useful for me to adjust my work creation ! , Could i have a some question ? : For now I have a project time observation process , In the work process have i need to know the method or code to do like a " Multi Section " in one worksheet such as i put the process step 1 , 2 , 3 row by row and i need to Crate time counter by row . Could you please to suggest me. P.s. I'm newbie for VBA knowledge . Thanks you

  • @internationalstatisticianm3952
    @internationalstatisticianm39523 жыл бұрын

    Thank you

  • @Exceltrainingvideos

    @Exceltrainingvideos

    3 жыл бұрын

    Welcome! Please share with your friends too.

  • @salvatoretesta9825
    @salvatoretesta98254 жыл бұрын

    Tnx great. :)

  • @Exceltrainingvideos

    @Exceltrainingvideos

    4 жыл бұрын

    You're welcome! Please share with your friends too.

  • @ricro880
    @ricro8804 жыл бұрын

    Thank for your helpful explanations . From your previous clip I learnt how to create a count down timer. I am having difficulty replicating this timer in several sheets in the same work book. When I try repeating the process say in sheet2 an ambiguity error comes up. Many thanks. Rick

  • @Exceltrainingvideos

    @Exceltrainingvideos

    4 жыл бұрын

    Please share your code here in the comments section for a sheet in which the code doesn't work.

  • @MrAnupam111
    @MrAnupam1118 жыл бұрын

    when I click or entered value in cell a1 timer auto start and when I complete my work and entered value in b1 timer auto end and show me the timing as how much time I consume in completing work in cell c1

  • @sodisaperedinonsaper
    @sodisaperedinonsaper11 жыл бұрын

    Thank you very much this is the tutorial I was looking for...I precisely followed your instructions, but when I click the Stop button...appears this error. How can I repair? Run-time error '1004': Method 'OnTime' of object'_Application' failed

  • @mickbro89
    @mickbro897 жыл бұрын

    Have been searching multiple forums today trying to work this out. This is nearly perfect for what I need. Just one quick question: If I wanted to display the timer say on a form by way of a label or text box and have the caption of the label update, instead of a cell in the Workbook, what should I use. Is it simply a matter of replacing the Range("A3").Value with something like Label11.Value?

  • @Exceltrainingvideos

    @Exceltrainingvideos

    7 жыл бұрын

    You can transfer the values from Range("A1"), for example, to a TextBox on a user-form. But it requires some coding tricks.

  • @ZubairChoudhary
    @ZubairChoudhary3 жыл бұрын

    Great

  • @Exceltrainingvideos

    @Exceltrainingvideos

    3 жыл бұрын

    Thank you! Please share with your friends too.

  • @Testing_QualityAnalyst_Channel
    @Testing_QualityAnalyst_Channel8 жыл бұрын

    Dinesh sir how can we set timer in Userform?

  • @xlNESxl
    @xlNESxl8 жыл бұрын

    Hi. I was wondering if i can update a label or textbox within the userform rather than an excel cell? thank you

  • @Exceltrainingvideos

    @Exceltrainingvideos

    8 жыл бұрын

    Check these links: www.exceltrainingvideos.com/tag/how-to-get-data-from-worksheet-into-combo-box-and-text-boxes-on-user-form/ www.exceltrainingvideos.com/transfer-data-from-user-form-to-multiple-worksheets-in-excel-workbook-using-vba/

  • @thecoolguy365
    @thecoolguy36511 жыл бұрын

    How to have the timer count in clock format. example when timer reaches 60 it should show 1:00. Thanks

  • @inKannada
    @inKannada9 жыл бұрын

    Hello Dinesh, i need to create Start, Pause and Stop time buttons in excel, could you please provide any videos on this topic. it would be very helpful. Thank you.

  • @Exceltrainingvideos

    @Exceltrainingvideos

    9 жыл бұрын

    Abdul Rehman Did you have a look at these videos?Timer in Excel@DlXNNHTcu4ECreate Order Timer in MS Excel using VBA @vEOXwnWMUTA

  • @tihenry2k
    @tihenry2k11 жыл бұрын

    Please how can I add millisecond to a timer using your codes?

  • @techvideos4281
    @techvideos42817 жыл бұрын

    Hi Dinesh, For Excel's cell u used code: Range("A3").Value=Range("A3")+1 but what shoud I use for the textbox in the userform? Please Help

  • @Exceltrainingvideos

    @Exceltrainingvideos

    7 жыл бұрын

    Search www.exceltrainingvideos.com or my KZread channel.

  • @drdrkarr
    @drdrkarr9 жыл бұрын

    Dinesh, your video on "How to Create Timer-Counter Using Excel VBA" worked perfectly for my application. I have run into a conflict between a Combo box on the same form which undesirably functions as a pause button for the timer when I activate the Combo box. As soon as I have made the selection from the dropdown list, the timer comes back to life and starts where it left off when it stopped. So I am not getting an accurate measure of the total time elapsed since starting the timer, because I lose a few seconds each time I activate the Combo box. Any help will be greatly appreciated. Thanks much in advance for your expertise. Dr. Donald Karr

  • @Exceltrainingvideos

    @Exceltrainingvideos

    9 жыл бұрын

    Donald Karr You could create a start and stop timer-button. You would stop the timer, select the item from the combo-box and again start the timer. Hope this helps.

  • @Sancarn
    @Sancarn9 жыл бұрын

    Hello Dinesh, How would one go about having a 20Hz timer? As in a counter that increments every 1/20th of a second? I would guess it is something like Application.OnTime Now + TimeValue("00:00:00:05")? Or does the TimeValue only work down to seconds?

  • @Exceltrainingvideos

    @Exceltrainingvideos

    9 жыл бұрын

    Sancarn Just try it out!

  • @Sancarn

    @Sancarn

    9 жыл бұрын

    Dinesh Kumar Takyar Yeah it didn't work sadly :/ It just returned an error! xD

  • @Exceltrainingvideos

    @Exceltrainingvideos

    9 жыл бұрын

    Sancarn Try this: Application.OnTime Now + TimeValue("00:00:001") and in the increment part: Range("A1").Value = Range("A1").Value + 0.1

  • @Sancarn

    @Sancarn

    9 жыл бұрын

    Dinesh Kumar Takyar It may have been because I am really new and did it in a multi worksheet document actually... (And I may not have put it in a module! Oops! xD) I will try again later! :D I'm just using excel to make a game and wanted a 20 Hz clock to make checks and stuff :D But so far I'm just doing some terrain generation exercises! I never knew excel could be so much fun!

  • @MrAnupam111
    @MrAnupam1118 жыл бұрын

    how to calculate auto timer calculation

  • @Exceltrainingvideos
    @Exceltrainingvideos11 жыл бұрын

    Check the spelling of Schedul --> Schedule

  • @ejazahmedev
    @ejazahmedev10 жыл бұрын

    Hi Gio, You have to call the Application.OnTime with Schedule:=False with the exact time you scheduled it to begin with. Hence it is a good idea to store the time you are scheduling a call to a public variable. And then use that variable to call the Application.Ontime procedure. That way, your StopUpdate procedure would work for sure. Let me know if that doesnt make sense.

  • @Theyrewrong827

    @Theyrewrong827

    Жыл бұрын

    yes

  • @Flyinghigher2011
    @Flyinghigher201111 жыл бұрын

    this is a count up timer i could really do with a COUNTDOWN timer please

  • @fab99fab
    @fab99fab8 жыл бұрын

    I have similar code for the timer start and stop but the problem is I am getting run time error 1004 stating method on time of object application failed. please help why m I getting this error ?

  • @MrAnupam111
    @MrAnupam1118 жыл бұрын

    please advise

  • @jannahashraf
    @jannahashraf9 жыл бұрын

    Hi Mr.Dinesh, Hope you are fine, I want to ask about how to put a timer - Counter on the user-form in Excel VBA that i Made an Exam with multiple choice with 50 Questions on 50 Forms (Next By next) and want the exam is close Automatically when the time is finished, So can you help in this issue.

  • @Exceltrainingvideos

    @Exceltrainingvideos

    9 жыл бұрын

    Ashraf Elsheikh This link might help: www.exceltrainingvideos.com/timer-in-excel-using-vba/

  • @rajaprabhas455
    @rajaprabhas45510 жыл бұрын

    Hi Dinesh, First wanna thank u for your video tutorials, they were very helpful for beginners like me. Dinesh, i need a help. i have a macro where i need to fill color in multiple cells in my excel using timer. i have the logic to fill the color and im using your macro code. its working fine, but as i am incrementing by second in the timer color updating is taking much time. i need to complete this in a few seconds so i need to use Milli Second in timer incrementing. as per your previous comments, i used Application.OnTime Now + TimeValue("00:00:01.001"), "INC" but its getting run time error-->type mismatch. Please kindly help me out on this issue. Thanks in advance :)

  • @Exceltrainingvideos

    @Exceltrainingvideos

    10 жыл бұрын

    Where are you placing the code for color change?

  • @rajaprabhas455

    @rajaprabhas455

    10 жыл бұрын

    Dinesh Kumar Takyar In place of Increment_count(), i have placed by function color_update.

  • @reeteshism
    @reeteshism4 жыл бұрын

    Hello there. Not sure whether this is the correct platform to ask this question, however was not able to find the video about the question which I'm going to ask. I'm trying to create a tracker on excel using VBA, which captures the "START TIME" and "END TIME" of a specific task. The tracker is almost complete. The only thing where I'm getting stuck is on the message box command. Suppose, there are 2 buttons "START TIME" & "END TIME". If without clicking on the "START TIME" button someone clicks on "END TIME", they will get a message box which says "Task Not Started". However, if a task is already started and ongoing and instead of clicking on "END TIME" to stop the task, the person clicks on "START TIME" again, it starts a new task and the old one doesn't end. If you could help me with the VBA Coding where in I'll be able to get a message box which says "End Previous Task", if someone clicks on "START TIME' again instead of clicking on "END TIME" to stop the ongoing task. Or copy the url of the video if you already have discussed this on any of your videos Thanks

  • @Exceltrainingvideos

    @Exceltrainingvideos

    4 жыл бұрын

    Good question. Will work on this query and make a video.

  • @iankarremans9397
    @iankarremans939710 жыл бұрын

    how can I change the format of the timer cell so it will read hours/Minutes/seconds?

  • @Exceltrainingvideos

    @Exceltrainingvideos

    9 жыл бұрын

    ian karremans You could use a code like so: Selection.NumberFormat = "h:mm:ss" ThisWorkbook.Sheets(1).Range("A1") = Time

  • @nishtha458
    @nishtha4584 жыл бұрын

    Userform me countdown timer kaise add kar sakte hai

  • @Exceltrainingvideos

    @Exceltrainingvideos

    4 жыл бұрын

    The link to this VBA tutorial will guide: kzread.info/dash/bejne/iGF7y7xrgMu-hag.html

  • @Macman123ization
    @Macman123ization11 жыл бұрын

    Application.OnTime Now + TimeValue("00:01:01"), "Increment_count", Schedul:=False - whats wrong?? Thanks, btw :) !

  • @delcote6442
    @delcote64426 жыл бұрын

    Why does the timer stop each time a change worksheets?

  • @delcote6442

    @delcote6442

    6 жыл бұрын

    It actually resets to 1, once I come back to the sheet

  • @sodisaperedinonsaper
    @sodisaperedinonsaper11 жыл бұрын

    Yes...all the code works except the stop... Sub StopUpdate() Application.OnTime Now + TimeValue("00:00:01"), "Copy", Schedule:=False End Sub

  • @Abubakar-ki8ex
    @Abubakar-ki8ex3 жыл бұрын

    i want timer in excel vba

  • @Exceltrainingvideos

    @Exceltrainingvideos

    3 жыл бұрын

    There must be at least 5 videos on this theme in this channel.

  • @Jay1637
    @Jay163711 жыл бұрын

    Is there a way to create a simple version of this in Excel without having to do all these ridiculous steps. Too much to do for such a small task. All I want to do is create a vacation countdown timer that includes the months, days, minutes and seconds.

  • @Abubakar-ki8ex
    @Abubakar-ki8ex3 жыл бұрын

    reply plz

  • @Exceltrainingvideos

    @Exceltrainingvideos

    3 жыл бұрын

    Replied.

  • @Abubakar-ki8ex

    @Abubakar-ki8ex

    3 жыл бұрын

    @@Exceltrainingvideos sir know i want if 2 cell value same ho then Stop Timer

  • @Abubakar-ki8ex

    @Abubakar-ki8ex

    3 жыл бұрын

    @@Exceltrainingvideos Your Some video helpful for me jasy increse number with timer in excel vba