+ Reply to Thread
Results 1 to 9 of 9

Stop running macro when time value in a cell reached or exceed

  1. #1
    Registered User
    Join Date
    04-26-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003 2007
    Posts
    69

    Stop running macro when time value in a cell reached or exceed

    I have a running macro to get live data from a real time data server, how to auto stop the macro from running if cell A10 time value reached/exceed a set value 14:00:00

    ty for help
    Last edited by bezbid; 06-25-2015 at 10:46 PM.

  2. #2
    Registered User
    Join Date
    06-12-2015
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    83

    Re: Stop running macro when time value in a cell reached or exceed

    Please Login or Register  to view this content.
    that's if you want exactly equal to 14

    For bigger or equal use this:


    Please Login or Register  to view this content.
    Last edited by JoeFoot; 06-25-2015 at 11:09 PM.
    Got help? Pls give rep.
    If you do R&D learn VBA

  3. #3
    Registered User
    Join Date
    04-26-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003 2007
    Posts
    69

    Re: Stop running macro when time value in a cell reached or exceed

    how is the code if time is 14:45:00

    Thank you joeFoot

  4. #4
    Registered User
    Join Date
    06-12-2015
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    83

    Re: Stop running macro when time value in a cell reached or exceed

    the 2nd instruction will stop the macro whenever the time is 14:00:00 or higher so it will work for 14:45:00

  5. #5
    Registered User
    Join Date
    04-26-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003 2007
    Posts
    69

    Re: Stop running macro when time value in a cell reached or exceed

    OK, how about 13:35:00, how would your 2nd code be

    can the first code be use like this,
    Please Login or Register  to view this content.
    thank you
    Last edited by bezbid; 06-25-2015 at 11:24 PM.

  6. #6
    Registered User
    Join Date
    06-12-2015
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    83

    Re: Stop running macro when time value in a cell reached or exceed

    the code only checks for the status of the first 2 digits (in this case 14)

    If you want it to stop after 13:35:00 you would need to introduce also a condition to check the 4 and 5 value of the string:

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Stop running macro when time value in a cell reached or exceed

    Hi bezdid,

    Here's one way you could do it:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  8. #8
    Registered User
    Join Date
    04-26-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003 2007
    Posts
    69

    Re: Stop running macro when time value in a cell reached or exceed

    thank you both, JoeFoot & Trebor76

  9. #9
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Stop running macro when time value in a cell reached or exceed

    thank you both, JoeFoot & Trebor76
    You're welcome. If you could mark the thread as solved it would be appreciated.

    Thanks,

    Robert

+ 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] Stop Macro adding when cell value is reached?
    By Margate in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2013, 10:30 PM
  2. Stop cell from updating when a date is reached
    By acampbeb in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2012, 08:27 AM
  3. Macro to stop deleting data when a certain row is reached
    By Philb1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2011, 05:43 PM
  4. Stop running a macro at a certain time
    By trey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2009, 09:45 PM
  5. [SOLVED] stop a macro from running everytime a cell is changed
    By bassfisher in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-06-2005, 10:05 AM

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