How to see worksheet changes while macro is running?

J

JoeU2004

Usually, I disable worksheet changes while a macro is running in order to
improve the macro performance.

But in this case, I want to see the worksheet changes as they occur.

Oddly, that is not happening. I suspect it is because the macro is so
compute-intensive that it is not giving the Excel window time to display the
changes.

(When I stop the macro, I do see the changes.)

Is there something I should be doing in a compute-intensive macro to allow
me to see worksheet changes in a timely manner?

Or is this just a quirk of the Windows O/S or Office 2003 or ...?

I know I can call the kernel Sleep() function to sleep for a specified
number of milliseconds. But that seems excessive, both in terms of
efficiency and as a programming requirement.

Note: The macro writes to the Immed Window (debug.print) as well as storing
into the worksheet.

PS: I have seen some funny things while this macro is running. For
example, when VBA is open, but not the Immed Window (as I recall), and Excel
is the active window, at some point in time, the Excel window is overlayed
with a partially written window -- presumably VBA, but perhaps the Immed
Window. I don't know if that is intermittent or consistent behavior. (I
tried it only once.)

Also, sometimes when I run the macro with the VBA and Immed Window on top
(VBA is the active window), the Immed Window will appear to be cleared, and
I cease to see updates to it, which should occur about every second. When I
stop the macro, the Immed Window updates appear. This behavior is
intermittent.
 
J

JoeU2004

Well, even a call to the kernel Sleep function after each worksheet update
does not permit me to see changes consistently, even when I disable auto
calc.


----- original message -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top