Screen Flickering VBA Excel

2019-08-02 16:18发布

This is something I have read a lot myself but couldn't find the solution. I have a program of about 10,000 lines where I have a procedure attach to a particular command button. This calculates some complex equations.

I have started the code as usual with Application.ScreenUpdating = False and turned it to True just before ending of the main procedure. Yet just the upper part of my Excel Sheet (near the Menu Bar) keeps flickering about 10 second until the result appears. I tried disabling events, as well as turning the calculations to manual, but nothing helps. Even tried mentioning screen updating to false at the beginning of sub procedures related to main procedure.

Any suggestion regarding this will be really appreciated. Thank you!

1条回答
Deceive 欺骗
2楼-- · 2019-08-02 16:51

Try adding this at the start of the sub:

Application.EnableEvents = False
Application.DisplayStatusBar = False
Application.Calculation = xlCalculationManual

And this just before the end:

Application.EnableEvents = True
Application.DisplayStatusBar = True
Application.Calculation = xlCalculationAutomatic

That should help. Note though, my screen also flickers sometimes when running complex macros (Excel looks like it's not responding, but it's working in the background).

查看更多
登录 后发表回答