+ Reply to Thread
Results 1 to 2 of 2

Pausing and restarting a macro using a button

  1. #1
    Registered User
    Join Date
    03-01-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    64

    Pausing and restarting a macro using a button

    Hello

    Please can anyone help with the following query?

    I have a macro that updates the month and year in a pivot table filter, refreshes the pivot table and then displays the results for a few seconds before looping round to update to the next month in sequence. I've added two buttons to the Excel tab for the user - one to start this macro, and a second to reset the month back to the start once the first macro has run to the end.

    Is it possible that I can add a third button that will allow the user to pause the macro on the first click, and then restart the macro by clicking the same button again?

    I am a VBA novice so there may well be a simple solution to this, but so far I'm stumped!

    Thanks
    Kenny

  2. #2
    Forum Contributor
    Join Date
    05-04-2012
    Location
    Stamford,Connecticut,USA
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Pausing and restarting a macro using a button

    Basically, what you have here is a misunderstanding on where the macro should end. In other words why would you want to stop a macro and obtain partially executed data. Must likely what you should do is breakdown your process in pieces so the button doesnt interrupt a macro, but basically stages the execution of your processes.

+ 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