+ Reply to Thread
Results 1 to 7 of 7

Where to insert progressbar macro in mulitple for loops

  1. #1
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Sweden
    MS-Off Ver
    2016.
    Posts
    397

    Where to insert progressbar macro in mulitple for loops

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    I have an userform named Progress and I am using two for loops and I am having trouble with what value I should put in the CurrentProgress variable??
    Please Login or Register  to view this content.
    I have tried 1600 (40*40), 800 and I want help with what value I should use and where to put the progressbar code??

  2. #2
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Sweden
    MS-Off Ver
    2016.
    Posts
    397

    Re: Where to insert progressbar macro in mulitple for loops

    As it is right now the code goes to 2%, then restarts at 0% and I don't know why.

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

    Re: Where to insert progressbar macro in mulitple for loops

    Start by moving the call of InitProgressBar to outside of the loop.
    To show progress through the outer loop replace ??? with 39, the upper limit of the loop.

    I don't understand what the inner loop is doing. Why set the ListIndex of ComboBox4 to the values 0 through 39?
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Sweden
    MS-Off Ver
    2016.
    Posts
    397

    Re: Where to insert progressbar macro in mulitple for loops

    Thank you for your reply! I have moved the call of InitProgressBar to outside of the loop.

    Imagine ComboBox1 and ComboBox2 being "County" and ComboBox3 and ComboBox4 are "Cities".

    This iterates through the items in the ComboBoxes.

    Ex. County0, City0 vs County0, City0
    Ex. County0, City0 vs County0, City1
    Ex. County0, City0 vs County0, City2
    Ex. County0, City0 vs County0, City3
    Ex. County0, City0 vs County0, City4

    etc.

    I want to show progress for the outer and the inner loop!

  5. #5
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Sweden
    MS-Off Ver
    2016.
    Posts
    397

    Re: Where to insert progressbar macro in mulitple for loops

    I think your suggestion with 39 worked like I wanted.

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

    Re: Where to insert progressbar macro in mulitple for loops

    Then you would need to move the progress code within the inner loop and keep a counter.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Sweden
    MS-Off Ver
    2016.
    Posts
    397

    Re: Where to insert progressbar macro in mulitple for loops

    Thank you for your reply! This code works great!

+ 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] insert text in fields (possibly mulitple) if certain conditions met
    By JeninQC in forum Excel General
    Replies: 9
    Last Post: 04-05-2017, 03:54 AM
  2. [SOLVED] VBA to find, copy and insert mulitple copied rows (newbie)
    By RandiLee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2013, 10:26 AM
  3. [SOLVED] To add a ProgressBar in Excel 2003 Macro
    By sugaprasad in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2012, 08:28 AM
  4. VBA Progressbar on several macro
    By mamarda in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2012, 04:37 PM
  5. sumifs with mulitple columns and mulitple criteria in each column
    By bkaufman in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-18-2012, 05:11 PM
  6. How to insert mulitple page breaks into a large file?
    By excelnoob250 in forum Excel General
    Replies: 8
    Last Post: 03-25-2009, 04:39 PM
  7. ProgressBar
    By Progress2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2008, 03:57 AM

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