+ Reply to Thread
Results 1 to 12 of 12

Progress Indicator need to progress along with my code running time

  1. #1
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Progress Indicator need to progress along with my code running time

    I have a workbook which has different codes. I have created a userform through which i want to show the progress of the code running time(I mean when code is started running it should start the progress and when code running completes, it should reach to 100%). Structure of my workbook is as:
    Module1: contains my coding
    Module2: contains code for progress bar
    Module3: contains code for calculating my code total runtime in seconds

    What i want is that how can i link my code running time to progress indicator.I mean progress indicator should progress with my code running time, Please help me with this. Attached is the workbook.

    Module 2 code:
    Please Login or Register  to view this content.
    Module 3 Code:

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Zahid0111; 05-03-2020 at 09:51 AM.

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

    Arrow Re: Progress Indicator need to progress along with my code running time


    Among samples on this forum a must see : simplistic Progress bar

  3. #3
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Progress Indicator need to progress along with my code running time

    Thank you Marc L...
    The issue is how can i run this with my code...?i mean how will it show my code execution progress..for instance, i am sharing my command button code here:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: Progress Indicator need to progress along with my code running time

    The only loop you have in the code provided is the For Each Rng loop.

    You could put the progress in there. You would need to the know the number of cells being processed in order to determine percent.

    Otherwise the only thing you can do is call the progress at various fixed stages in the code where you provided a static amount completed.

    Is the wait command in there for any particular reason?
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Progress Indicator need to progress along with my code running time

    @Andy Pope Thank you for reply...
    Can you please help me to call the progress in my code, how it can be done please?

    The wait command waits for the conversion(pdf to excel) process to complete, after which below codes run? is this wrong?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: Progress Indicator need to progress along with my code running time

    I don't know. What happens at the pdf command? Does it step straight over it and the pdf is created in the background as another process or does it not move on to the next line until after the pdf is created?

    button code
    Please Login or Register  to view this content.
    Add this to the top of Module1
    Please Login or Register  to view this content.
    Userform1 code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Progress Indicator need to progress along with my code running time

    Basically at pdf, it starts converting pdf file to excel file, after conversion i fetch data from excel file to my main file. So during conversion i put wait command.

    Thanks for helping in progress code. let me try it...

  8. #8
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Progress Indicator need to progress along with my code running time

    Works great...
    Thank you @Andy Pope and @ Marc L for your kind help...

  9. #9
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,295

    Re: Progress Indicator need to progress along with my code running time

    A little bit late - I had to extract it from a mass of code.
    I tend to cheat by approx timing splits in operations.
    As per a splash screen from one of my apps.
    The ops go between each sequence of progress bars.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Progress Indicator need to progress along with my code running time

    Quote Originally Posted by torachan View Post
    A little bit late - I had to extract it from a mass of code.
    I tend to cheat by approx timing splits in operations.
    As per a splash screen from one of my apps.
    The ops go between each sequence of progress bars.
    @torachan
    Wow this is great...welldone...Can you please help me, how can i incorporate in my code please?

    Please Login or Register  to view this content.

  11. #11
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,295

    Re: Progress Indicator need to progress along with my code running time

    Before I do, does the rest of your code actually work ?

  12. #12
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Progress Indicator need to progress along with my code running time

    Yes 100% working

+ 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] Progress Indicator code placement
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-30-2016, 01:20 PM
  2. Progress indicator or countdown timer while refresh macro is running
    By DanGres in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2014, 09:21 PM
  3. Donut Style Progress Indicator not executing while other code is running
    By UCAnalytics in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2013, 05:20 AM
  4. long running macro - progress indicator tips needed
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2012, 01:02 AM
  5. Status bar progress indicator stops updating part way through code execution.
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2012, 07:45 PM
  6. Progress Bar Indicator
    By coneill0422 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2011, 07:18 PM
  7. Progress Indicator
    By excel_lover in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2009, 04:59 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