+ Reply to Thread
Results 1 to 2 of 2

how to run a macro on the minute every minute

Hybrid View

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    how to run a macro on the minute every minute

    I'd like to run a macro 20 seconds after the clock of the computer completes a minute, so for example, at 7:18:20 pm, then 7:19:20, then 7:20:20 pm and so on until I stop it. I've looked around for code on the web, but all I can find is something similar to this:

    sub test()
    Application.OnTime Now + TimeValue("00:01:00"), "my_macro"
    end sub
    the code above would run something every minute, I believe, but only every minute starting from the time you execute the sub named "test". What I'd like is code that specifically runs x amount of seconds after the computer clock completes a minute, no matter when I execute it. So if I execute the "test" macro above at 7:17:40 pm, I do not want it to run until 7:18:20 pm. Is this possible?

    Also, since it will be on an infinite loop, can I stop it with another macro? I can just tie a button to it...

    Thank you.
    You either quit or become really good at it. There are no other choices.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: how to run a macro on the minute every minute

    You need more than that. You're going to have to schedule every time that it runs.

    Take a look at this recent thread and ask questions as needed:


    http://www.excelforum.com/excel-prog...ml#post4239101
    Last edited by GeneralDisarray; 11-19-2015 at 08:46 PM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Reduce 1 minute data to 30 minute data in Excel
    By MilanBawa in forum Excel General
    Replies: 9
    Last Post: 02-24-2022, 12:48 PM
  2. [SOLVED] Record on/off time for minute by minute data set
    By bdenzer in forum Excel General
    Replies: 5
    Last Post: 07-30-2015, 07:41 PM
  3. Replies: 2
    Last Post: 11-27-2013, 01:26 PM
  4. [SOLVED] Macro that runs every minute when System Clock changes minute?
    By naira in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2013, 04:11 PM
  5. Correspond Dates to Minute by Minute Data
    By chubby127 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2013, 05:50 AM
  6. rolling minute data into 30 minute averages
    By grc1980 in forum Excel General
    Replies: 0
    Last Post: 08-30-2006, 03:58 PM
  7. [SOLVED] convert time from 60 minute hour to 100 minute hour
    By Jboerding in forum Excel General
    Replies: 2
    Last Post: 07-06-2005, 06:30 PM

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