How to Display Started and Completed Status in Excel VBA
Question details
The user wants to update a worksheet cell to show when a VBA macro starts and finishes, ensuring the visual text update is displayed even if screen updating is disabled.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Running a long VBA macro where the user needs visual feedback on the spreadsheet to confirm the execution status at the beginning and end of the code.
- Observed behavior
- Changes to the worksheet (like setting a status cell to 'Started') do not appear immediately on the screen because the macro locks up the UI or Application.ScreenUpdating is turned off.
Ensure you have the Developer tab enabled in your spreadsheet application and have a basic understanding of accessing the Visual Basic Editor (Alt + F11).
Use DoEvents to Force Screen Refresh
Insert the DoEvents command immediately after updating the status cell. This temporarily pauses the macro to allow the operating system to refresh the screen, ensuring the status text is visible.
When running complex macros, developers often disable screen updating (Application.ScreenUpdating = False) to speed up execution. However, this prevents intermediate cell changes, like writing 'Started' to a status cell, from being rendered on the screen.
To bypass this, you can use the DoEvents function. It tells the application to process any pending visual updates before continuing with the heavy macro workload.
Press Alt + F11 to open the Visual Basic Editor. Insert a new Module from the 'Insert' menu if you don't already have one.
Start your subroutine and add 'Application.ScreenUpdating = False' to prevent the screen from flickering during the main execution.
Update your target cell, for example, 'Range("A1").Value = "Started"'. On the very next line, type 'DoEvents' to force the application to draw this text onto the screen.
Write the rest of your macro code. At the end of the script, update the cell with 'Range("A1").Value = "Completed"' and restore screen updating by setting 'Application.ScreenUpdating = True'.

Write and Run VBA Macros Seamlessly in WPS Office
WPS Office provides robust, built-in support for VBA macros, allowing you to automate tasks and track script execution status exactly as you would in Microsoft Excel.
- 1. Download WPS Office: Install WPS Office for free from the official website and open WPS Spreadsheet.
- 2. Access the Developer Tab: Navigate to the 'Developer' tab on the ribbon and click on 'Visual Basic Editor'.
- 3. Paste and Run Your Code: Paste your macro containing the DoEvents command and run the code to see your real-time status updates in the cells.

Frequently Asked Questions
Why doesn't my status cell update automatically without DoEvents?
When VBA runs a heavy procedure or when Application.ScreenUpdating is set to False, the application pauses UI updates to allocate processing power to the macro. The DoEvents function briefly pauses the macro code to let the application process pending events, like drawing the updated cell text on your screen.
Can I display the macro status in the status bar instead of a worksheet cell?
Yes. You can use 'Application.StatusBar = "Started"' to show the execution status at the bottom of the window. Remember to reset it back to normal by using 'Application.StatusBar = False' just before your macro ends.
Will using DoEvents slow down my VBA macro?
Calling DoEvents too frequently, such as inside a loop that runs thousands of times, will significantly slow down your macro because it forces the system to pause and check for events repeatedly. It is best used sparingly, like at the start and end of a script, or at major procedural milestones.




