Closed Thread
Results 1 to 7 of 7

Pause and resume button using VBA

  1. #1
    Registered User
    Join Date
    09-15-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    9

    Pause and resume button using VBA

    if i have this 2-D figure walking a straight line or
    a ball rolling a continous motion and speed,
    i created a form which have a pause and resume on it
    what code should i put in for these two button for them to work?
    i.e. i need to code under

    Please Login or Register  to view this content.
    and the resume button should do nothing when the figure is moving,
    and pause shouldnt anything when the figure is paused.

    can someone please help me with the code?
    Thanks you a million!

  2. #2
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Pause and resume button using VBA

    Hi,

    This will make a pause for 10 secs.
    Please Login or Register  to view this content.
    Hope this helps!
    VIjay

    If you find any of the post useful to your question, please add to the contributor's reputation by clicking the blue scales icon in the blue bar of the post.

  3. #3
    Registered User
    Join Date
    09-15-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Pause and resume button using VBA

    hmm, but how to resume lol
    thanks anyway,

    btw, if cant make pause codes
    can someone tell me how to make a stop button then?
    something similar to the CTRL+ALT+ESC function if pauses is too hard?

  4. #4
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Pause and resume button using VBA

    For your understanding:
    The above code will help to pause for 10 sec and will resume after the 10 sec.

    To stop use:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Pause and resume button using VBA

    Quote Originally Posted by vijay2482 View Post
    For your understanding:
    The above code will help to pause for 10 sec and will resume after the 10 sec.

    To stop use:
    Please Login or Register  to view this content.
    I don't think that code will work how the OP wants, it will work within the routine but not from a separate button.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Pause and resume button using VBA

    You would need some sort of public variable that is checked periodically by the code doing the animation. If it's true, carry on; if not, pause. Your other two buttons then just need to set the value of the variable as needed.
    Remember what the dormouse said
    Feed your head

  7. #7
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Pause and resume button using VBA

    Something like this has to be done:
    Please Login or Register  to view this content.

Closed Thread

Thread Information

Users Browsing this Thread

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

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