+ Reply to Thread
Results 1 to 5 of 5

Show Elapsed Time (in realtime) On UserForm While Marco Runs

  1. #1
    Registered User
    Join Date
    01-20-2015
    Location
    Washington Township, New Jersey
    MS-Off Ver
    2010
    Posts
    2

    Question Show Elapsed Time (in realtime) On UserForm While Marco Runs

    Hello All!!!

    I'm trying to wrap my brain around a little problem I'm having. I've create a code to automate some processes in an excel workbook for my office, however it tends to take a little while to iterate and complete the process.

    To keep any users of the workbook from freaking out and thinking excel is hanging on them, I've also implemented a progress bar on a Userform.
    Untitled.png

    While I've got the '% Complete' section figured out, I am trying to also show the elapsed time it is taking to run the macro. My current code simply updates the userform with the elapsed time for the procedure, but I would like to have it constantly updating the elapsed time. Despite countless searching, I can't find anything that gives me insight into how you show the elapsed time in real-time while also letting the macro run in the background.

    Any help with this issue would be greatly appreciated. I've attached some of my code in hopes someone out there can help. Thanks in advance!!!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hello !

    First see how many time needs your procedure without such a progress bar
    as often the progress bars are very not smart designed, in fact just a very bad logic of the code author …

    I remind a VBA progress bar procedure needed more than a minute to execute
    and without the progress bar it lasted less than five seconds !

    If your progress bar is not smart, you can replace it just with a classic waiting message
    or better think to update the progress bar only when it's necessary, so far so better …
    Last edited by Marc L; 01-29-2020 at 06:34 PM. Reason: typo …

  3. #3
    Registered User
    Join Date
    01-20-2015
    Location
    Washington Township, New Jersey
    MS-Off Ver
    2010
    Posts
    2
    The process takes substantial time without the progress bar (typically 4 minutes). This progress bar implementation only adds maybe 5 or 10 seconds to that, which I'm not worried about. What I am worried about is that without a running timer showing while the code executes, users will think the workbook is stuck on calculations and try to break out of the operation.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    So better than a partial code it seems you missed the top page yellow banner, could be so easier for any helper …

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Show Elapsed Time (in realtime) On UserForm While Marco Runs

    Hello nagha3,

    Updating objects in real time is a bit advanced. Probably why you have not found it your searches. I have put together a UserForm with a progress bar similar to what you posted.

    You update the progress bar by calling the macro UpdateProgressBar and passing the completed amount as percentage: .01 to 1. It is up to you to determine the percentage of completion.

    The attached workbook has a working example.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. Replies: 3
    Last Post: 04-30-2018, 11:46 PM
  2. [SOLVED] How to subtract Time Values contained in Labels on a userform - Time Elapsed Live Clock
    By deadeye_draken in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-18-2017, 06:44 AM
  3. show elapsed count from two fields
    By alyssaross in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-26-2015, 12:39 PM
  4. show time elapsed in seconds
    By nasim12w in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2014, 03:55 PM
  5. Using start/end time fields on userform to populate elapsed time on spreadsheet
    By Lothar69 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2011, 05:07 PM
  6. Replies: 1
    Last Post: 07-01-2010, 11:32 AM
  7. show elapsed time ?
    By heathcliff in forum Excel General
    Replies: 3
    Last Post: 06-14-2005, 05:05 PM

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