+ Reply to Thread
Results 1 to 4 of 4

Simple Counter

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Simple Counter

    I have gotten the basics of buttons down but I can't figure out how to do a simple counter where on a button click you Start counting up 1 2 3 4, but at intervals of X ( as defined in a cell ) so for example - if X is 3 the counter would go 1, wait 3 seconds, 2, wait 3 seconds, 3 - this will keep counting until Y seconds have passed where Y is defined in an other cell.

    Anyone have any ideas how to go about this?

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Simple Counter

    you are looking for a timer.. I found this in the VBA help under timer
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-10-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Simple Counter

    Quote Originally Posted by rcm View Post
    you are looking for a timer.. I found this in the VBA help under timer
    Please Login or Register  to view this content.
    I did this and got Y seconds working no problem thank you!!

    When I tried to do a nested loop for the X intervals I just end up crashing Excel.

    How would I go about having Z increase by one every X seconds over the period of Y seconds from here? really scratching my head here. I have Z updating by one every time the loop is triggered and the loop only lasts for Y seconds
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Simple Counter

    the trick is the statement DOevents to allow user interruptions. I coded the timer so if the pause is 0 it will stop
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1