+ Reply to Thread
Results 1 to 9 of 9

Indicate if Macro is Running or Has Stopped

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

    Indicate if Macro is Running or Has Stopped

    I have the following code that runs on a timer all day long. Sometimes I have problems with the macro and it will stop running intraday and occasionally I will not realize that it has stopped for a few hours. Is there a way to add some kind of indication in a cell on my worksheet that the macro is running or has stopped?



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

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Indicate if Macro is Running or Has Stopped

    In one of your macros put a time stamp in a cell that you can look at that shows the last time that part of the code occurred. If the macro stops, that time stamp will stop getting updated.

    You could put conditional formatting on that cell, too, so that if the value in the cell is greater than 5 minutes ago, it turns red to catch your attention.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

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

    Re: Indicate if Macro is Running or Has Stopped

    Thanks I will do this!

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

    Re: Indicate if Macro is Running or Has Stopped

    Can you help me write a conditional format formula to use on the cell with the time stamp in it?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Indicate if Macro is Running or Has Stopped

    Assuming the cell with the timestamp in it is cell M4, this would be the CF formula for a 5 minute test:

    Formula IS: =NOW()-M4>0.0034722

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

    Re: Indicate if Macro is Running or Has Stopped

    how does 0.0034722 equal 5 minutes?

  7. #7
    Forum Contributor
    Join Date
    07-24-2008
    Location
    Athome
    MS-Off Ver
    Excel 2013
    Posts
    127

    Re: Indicate if Macro is Running or Has Stopped

    Quote Originally Posted by rhudgins View Post
    how does 0.0034722 equal 5 minutes?
    excel works on 1440 minutes per day (24 x 60)
    00:05 is 5/1440 = 0.034722

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Indicate if Macro is Running or Has Stopped

    If you want to make your formula easily editable, you can replace that number with the formula demonstrated by rasonline:

    Formula IS: =NOW()-M4>5/1440


    Just edit the 5 to whatever number of minutes you want.

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

    Re: Indicate if Macro is Running or Has Stopped

    perfect thanks

+ 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