Written by Allen Wyatt (last updated August 12, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
When Dave writes a macro that must process a lot of information in a For...Next loop, he always uses the status bar to indicate progress. Typically, he'll have a message displayed there such as "Processing row X of Y." When "Y" is a large value (the top end of the For...Next loop), Excel often stops updating the status bar and displays something like "Not Responding" in Excel's title bar. The macro is still running, though, and when it completes, Excel starts responding and everything works like it should. Dave wonders how he can make Excel stop behaving in this manner and, instead, display the status bar updates like he wants.
This behavior seems to occur when it appears to Windows that Excel has stopped responding. (It is Windows, after all, that is responsible for what appears in a program's title bar.) I was able to reproduce the behavior quite easily if I have multiple programs open in Windows and I click to another program window while Excel is chunking through a long macro. Essentially, if Excel is busy performing the macro or it cannot keep up in asking Windows to update the status bar, then it does, indeed appear like Excel has stopped responding.
There are two possible approaches that can be used. First, you could use the DoEvents command within the loop. Normally this is used to instruct the macro to pay attention to anything that is in the events queue, such as when someone presses the keyboard. It is equivalent to forcing Excel to "look up" from the macro on which it is working and to communicate with Windows. This would, necessarily, let Windows know that Excel really is responsive and allow the updates to the status bar to occur. You could even put the command right after updating the status bar:
Application.StatusBar = "Processing row " & X & " of " & Y DoEvents
The other thing to try is to simply not update the status bar as much. If the upper end of your loop is very large, then it might be better to calculate a percentage and update the status bar when some portion of the total is completed—perhaps every 5% or 10% of the total. This would mean the status bar only needs to be updated 10 or 20 times during the loop, rather than hundreds or thousands of times. This may mean that Windows can keep up with the requests to update the status bar and, as a bonus, your macro may run faster because it doesn't have to update the status bar as often.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13341) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021.
Best-Selling VBA Tutorial for Beginners Take your Excel knowledge to the next level. With a little background in VBA programming, you can go well beyond basic spreadsheets and functions. Use macros to reduce errors, save time, and integrate with other Microsoft applications. Fully updated for the latest version of Office 365. Check out Microsoft 365 Excel VBA Programming For Dummies today!
It is often helpful to get user input within a macro. Here's a quick way to present some options and get the user's response.
Discover MoreExcel keeps track of the actions you take so that you can undo those actions if any are taken in error. You may want to ...
Discover MoreYou can easily use formulas to pull apart text stored in a cell. For instance, if you need to pull individual characters ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2025-08-12 10:18:51
jamies
Sometimes pounding on the Esc key will cause a "break" in the processing
There is the facility to have a macro break into "Debug" mode - but you should ensure the developer tab is shown on the ribbon
And - you can always use the messagebox - in association with status updates -
invite the screen viewer to indicate when the message input facility should next be presented.
Those do, however require the excel session be running with the display being active, rather than as a background task.
and - ideally there should be an option/entry to bethe "debug" now option,
Debug.Assert False
and a just get on with it till it ends option
and there is the ask every nnnnn lines mode where the user enters the nnnnn into the messagebox, to set a loop
And - for "professional debugging -
have a bit of code to check for the existence of a logging file, specific name & location
with a specific content as the first line - just so the process knows it is it's logging file for output
that to have a second line giving:
number of the data blocks/rows etc. to process before writing to the log file
number of blocks/rows of data processing to be logged,
action to take at that point of done all them, - ask how many more ?
level of information to post to the log -
row/block number in the input?, with the identifying keys?, and the data, and row/block number generated in the output ? or id of entry updated ?
you get the concept -
that allows a remote operation for a client to have problem diagnostics created -
written (appended) to the log file wit the creation of that file being under the user's, or IT support staff control, and it's renaming, and moving (sending) to a location for you to view it in it's entirety,
or for them to extract whatever entries seem to cause the glitch in the processing.
And for those with unix utilities - there is the Unix/Linux tail command
Also - do remember autosave should be at intervals that are long enough for the block of entries, or all the process to be performed.
2025-08-12 06:52:48
Brian
Another approach is to create a look-alike progress bar. This can be achieved by having a wide(ish) cell or a merged row with a conditional format of 'Data Bar' and a minimum value of 0 and a maximum of whatever equates to 100% of the macro loops. The format of the cell needs to be set to "Processing Row:";;; and the next cells to the right set to the current progress, ' of ' and the maximum. I have my data bar set to a solid bar, solid fill, left to right and green. I have 2 other conditional formats - one that set the background of the 'slider' to red if the number processed is > 0, then as soon as the macro starts it write a value to the status bar cell, so the bar appears green on red, with the green bit gradually obscuring the red. The second conditional sets the cell font color to white if the cell value is 0. When the macro finishes it sets the bar value to 0, so the text 'vanishes'.
If the macro is running with screenupdating set to false, it has to be set to true just before the new number is written to the bar cell and then set back to false immediately after.
2020-12-12 11:12:33
J. Woolley
My Excel Toolbox includes the freely available ProgressBar_Text and ProgressBar_Form procedures. ProgressBar_Text uses the status bar. ProgressBar_Form includes a user form. I like to use the latter with Lightbox_Initiate to obscure the Excel window while a long macro is running, followed by Lightbox_Terminate. See https://sites.google.com/view/MyExcelToolbox/
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments