+ Reply to Thread
Results 1 to 5 of 5

Can Application.OnTime be stopped at a specified time

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Can Application.OnTime be stopped at a specified time

    I have the following code that starts at a specified time in cell X57 and runs every 30 seconds until the iNumber is reached. Is there a way to change the code to stop at 4:00pm instead of when the specified iNumber is reached?


    Please Login or Register  to view this content.
    Last edited by rhudgins; 04-14-2011 at 05:38 PM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    12,305

    Re: Can Application.OnTime be stopped at a specified time

    Instead of testing the counter, test if Hour(Now()) < 16 before rescheduling.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Can Application.OnTime be stopped at a specified time

    Thanks. If I wanted to change it to 4:15pm then what would the code change to?

    If Hour(Now()) < 1615?

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    12,305

    Re: Can Application.OnTime be stopped at a specified time

    More like:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Can Application.OnTime be stopped at a specified time

    Thank you this works nicely.

+ 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