+ Reply to Thread
Results 1 to 3 of 3

Display Qty per Minute (Working with Dates & Times)

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Question Display Qty per Minute (Working with Dates & Times)

    I have a macro that displays a time taken msgbox before End Sub. It works but I want it to return a Msgbox displaying No of Loops Per Minute. How do I do this?

    Extracts of code below:

    Near Start of Sub
        
    Dim dtmStopWatch  as date
    dtmStopWatch = Now()
    At End of Sub
    dtmStopWatch = Now() - dtmStopWatch
    
        Msgbox "Completed - time taken : " & Format(dtmStopWatch, "hh:mm:ss.00") & "  Loops= " & UBound(varArray)
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Display Qty per Minute (Working with Dates & Times)

    That code merely displays the START time (and loops), not the elapsed time.
    You'd need
    Format(Now() - dtmStopWatch, "hh:mm:ss.00")
    for the elapsed time.

    Now that is handing fractions of a day and you'd have to convert that to minutes (multiply by 24 x 60) and then divide loops by the result.
    Last edited by brynbaker; 07-19-2013 at 01:45 PM. Reason: typo

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Display Qty per Minute (Working with Dates & Times)

    *24*60 = just what I wanted to know. Thanks! +1

    P.S. My code was already returning the elapsed time. Check the first line of "At End of Sub".

+ 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. Correspond Dates to Minute by Minute Data
    By chubby127 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2013, 05:50 AM
  2. Calculating working hours between two dates/times!
    By JDGreen17 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-22-2013, 07:46 AM
  3. Working with negative dates and times
    By mrteater in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2013, 11:54 AM
  4. [SOLVED] working out lead times with 2 dates
    By NinjaBear in forum Excel General
    Replies: 2
    Last Post: 07-02-2012, 05:04 AM
  5. Working with dates and times in excel
    By skatmandu2002 in forum Excel General
    Replies: 2
    Last Post: 05-05-2008, 06:58 AM

Tags for this Thread

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