ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Screen flashing during macro execution: Interesting observation (https://www.excelbanter.com/excel-programming/289896-re-screen-flashing-during-macro-execution-interesting-observation.html)

Juan Pablo González

Screen flashing during macro execution: Interesting observation
 
Are you activating the other sheets ? and if so, do you have any code in the
Activate/Deactivate events of those sheets ?

--
Regards,

Juan Pablo González

"jasonsweeney " wrote in
message ...
I ran a macro, from a useform, that inserted about 100 comments into
cells on 10 different worksheets.

As many have talked about in this forum, the screen "flashed" durign
execution of the macro, despite that in the code was written:

_________
Application.ScreenUpdating = False
' Sheet1 code
' Sheet2 code
' etc.
Application.Screenupdating = True
__________

For giggles, I changed the code to:

_________
Application.ScreenUpdating = False
' Sheet1 code
Application.Screenupdating = True
'
Application.ScreenUpdating = False
' Sheet2code
Application.Screenupdating = True
'
Application.ScreenUpdating = False
' etx.
Application.Screenupdating = True
__________

Of course, this did not solve the problem, as many have commented.
Then I tried this:

Application.ScreenUpdating = False
' Sheet1 code
Application.ScreenUpdating = False
' Sheet2code
Application.ScreenUpdating = False
' Sheet3.code
Application.Screenupdating = False
' Etc.
Application.Screenupdating = False

And,.........it Worked! I only got one screen "flash" by doing it this
way. The macro still wasn't as quick as one would desire, but it did
solve the flashing issue. Just wondering if anybody else has
experienced success with this strategy.

Jason Sweeney


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com