Visual Counter On Form

  • I have a workbook that has a login form. I set it up so that if the user does not log in within 2 minutes a nother form will pop up telling them the workbook will close due to no activity. What I want to do is put a timer on that for that counts down the seconds before the workbook exits and at the sametime give them an opportunity to cancel the action.


    I cant seem to figure out a way to make anything that ticks of the seconds and allows me to press the cancel button at the same time. Your help is appreciated!!!

  • Re: Visual Counter On Form


    Thank you, I actually got something working to an extent. But, for some reason my cancel button does not work while my timer is counting down. I'm sure I did something wrong, and will try to post my code in the morning.

  • Re: Visual Counter On Form


    If you see anything wrong with my code I couod use the insight!



    I haven't actually put in the part that closes the workbook yet.

  • Re: Visual Counter On Form


    Please note:


    In the help file for Wait


    Wait Method
    See AlsoApplies ToExampleSpecificsPauses a running macro until a specified time. Returns True if the specified time has arrived.


    Important The Wait method suspends all Microsoft Excel activity and may prevent you from performing other operations on your computer while Wait is in effect. However, background processes such as printing and recalculation continue.

  • Re: Visual Counter On Form


    Quote from Reafidy

    Have a look at what iv attached it is a userform with a counter and a 2 minute timer.


    Reafidy, your method has been working for me pretty good. I had to modify it a bit to get it to do what I want, but I am experiencing a few glitches every now-and-then that I don't quite understand. I am going to try a few more things, then I will post a copy of my modifications to see if you have any ideas on a solution.


    Thanks for a good starting point!!! I really appreciate it: D

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!