+ Reply to Thread
Results 1 to 4 of 4

Create a macro that incorporates a delay

  1. #1
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Create a macro that incorporates a delay

    Hi,

    I've created a dashboard report in work that feeds from three data sources all held on separate tabs. To update the reports I refresh each tab individually through the use of a macro on each and manually refresh the related pivot tables that feed off them. It only takes me 5 mins to update the report but ideally i'd like the whole process undertaken through the click of a button. I tried to achieve this by creating a macro that refreshes the first set of data, then the second, then the third and then the pivot tables, but when I run it it appears to want to do it all at the same time which causes excel to crash. Can I insert a time delay between each data and pivot refresh so the process is a lot smoother and actually works? Each data refresh takes 30 secs max and the pivot refreshes are pretty much instantaneous so i'd only want a couple of seconds delay for these.

    Thanks in advance,

    Snook

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Create a macro that incorporates a delay

    Here's code you can modify to get done what you need:
    http://www.bygsoftware.com/Excel/VBA/pause.htm
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

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

    Re: Create a macro that incorporates a delay

    See the Wait method
    Hope that helps.

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

    Free DataBaseForm example

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Create a macro that incorporates a delay

    To include waiting time of 10 secs pl add this code in your macro where ever required.

    Please Login or Register  to view this content.

+ Reply to 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