+ Reply to Thread
Results 1 to 17 of 17

Macro Progress Bar

  1. #1
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483

    Macro Progress Bar

    Hi,
    As i have a pretty "complex" macro, which takes around 20-30 minutes to do (honestly)....
    I was wondering if there was a way to create a progress bar just showing me how many % it has done so for?

    Or even tell me which sub routine it is up to? (but % would probably be better)

    And preferably a pop-up box one?.. not one on the status bar because i have stuff updated on the status bar already...
    Thanks in advance =]
    Last edited by pr4t3ek; 10-27-2008 at 07:54 AM.
    --
    Regards
    PD

    ----- Don't Forget -----

    1. Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks

    2. Thank those who have helped you by Clicking the scales above each post.

    3. Please mark your post [SOLVED] if it has been answered satisfactorily.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    See http://www.andypope.info/vba/pmeter.htm
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    i've had a look at the code for a few minutes & i've inserted my code where appropriate but it doesnt seem to work?

    I guess i can try a bit later and put some into it but is there a way to just get me to code for the progress bar?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Post your code.

  5. #5
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    What am I missing? Doesn't this line do what you want?
    Please Login or Register  to view this content.
    Last edited by shg; 10-26-2008 at 11:50 AM.

  7. #7
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    there are other parts to the code which i have not included, which is whole another macro (which i have not finalized yet) hence why i was hoping that you could work with what i've provided you & i'll work around that.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    I might, but I don't see what you're trying to do. You have a progress indicator in the status bar now that reports progress of the only loop in your code.
    i've inserted my code where appropriate but it doesnt seem to work?
    What code have you inserted where?

  9. #9
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    I opened up the link that you sent me.
    I opened up the Progressmeters.xls file..
    and i put all the code that i've put up in my previous message in:
    Please Login or Register  to view this content.
    i put my code in:

    Please Login or Register  to view this content.



    There is a lot more code, which will not fit into this message. Thank You

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    That's going to execute whatever code you put there 100 times - is that what you want?

    The thrust of Andy's examples were to show how to create progress meters -- you have to adapt the code to your application.

    Are you trying to show the percent of lines read from the given file?

  11. #11
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    no what im after is a progress bar for the whole macro.

    Say for instance, from the time i execute my macro, it takes 10 minutes to complete "the whole macro" once, i would like a progress bar telling me the progress of the macro.

    Just like the one in my code which shows the progress of the loop, but i want one for the "whole" macro...

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Then you need to have points in the macro that you can compute relative progress.

  13. #13
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    and what does that exactly mean?

    I'm sure someone has code which has this, it shouldn't be too complicated?

  14. #14
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,480
    It's complicated in the fact that you have to determine how far the macro has progressed because you are not reporting a loop only process.

    So you need to pick points in your code that reflect progress points in your whole macro.
    Cheers
    Andy
    www.andypope.info

  15. #15
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    and how do i do that exactly?

    so can that be done when it changes subroutines maybe?

    i've prob got like 12 subroutines so. How many it's done so far divided by total subroutines times 100??

    how would i go about implimenting that exactly..

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

    Wink

    You would use something like the following.
    Assume 3 routines that each take 1/3 of the processing time.

    Please Login or Register  to view this content.

  17. #17
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483
    awesome,
    that helped..

    my final result is attached.

    thanks guys for all your time.
    Attached Files Attached Files

+ 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