Share via

progress indicator in VBA

Anonymous
2010-10-14T20:01:02+00:00

Hi All,

I have a long-running VBA program and was wondering if there was a way to send progress reports while running. I know you can use msgbox but it stops the program until you clear the message box.

Are there other ways to handle this?

thanks,

rod.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-10-15T23:47:44+00:00

The link provided by Gary:

http://spreadsheetpage.com/index.php/site/tip/displaying\_a\_progress\_indicator/

and that provided by Pete:

http://www.andypope.info/vba/pmeter.htm

are very helpful for creating "professional"Progress Indicators with really minimum effort.

I wasn't aware that such thing is available and easily accessible!  I have been using the classicApplication.StatusBar to show progress in lengthy VBA macros.  That was until now:)

Thank you.

Was this answer helpful?

0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-10-16T01:18:41+00:00

    You're welcome - thanks for feeding back.

    Pete

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2010-10-15T08:50:28+00:00

    Andy pope has a workbook that you can download from here:

    http://www.andypope.info/vba/pmeter.htm

    which shows a variety of different progress indicators that you can easily implement.

    Hope this helps.

    Pete

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2010-10-15T05:37:56+00:00

    Rod,  I am far from an MVP but for simple stuff I use the Application.StatusBar

    (It controls the word "Ready" you see in the lower left corner of the screen)

    Suppose I have a proc processing rows 100 to 10,000

    For Row = BegRow to EndRow

        'Your App's code here

        'To change the status bar every 500th row

        if row mod 500 = 0 then Application.StatusBar = "Done with Row " & Row & " Out of " & EndRow

    Next Row 

    Application.StatusBar = False  'Turns text back to "Ready" at processing end

    I've found that the changing text draws your eyes to it, so no announcement to look there is even needed.

    Also, you did not mention what kind of processing is taking the "long time" so remember two biggies, but easies, for speeding up processing:

    Application.ScreenUpdating = False  'dont show updated values in cells 'til the end

    Application.CalculationMode = xlManual  'don't recalc values until you have to.

    'Your code goes here

    Application.CalculationMode = xlAutomatic

    Application.ScreenUpdating = True

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2010-10-14T20:10:51+00:00

    Was this answer helpful?

    0 comments No comments