OzGrid

Stop Screen Flicker in Excel

< Back to Search results

 Category: [Excel]  Demo Available 

Stop Screen Flicker in Excel

 

Excel: Stop Screen Flicker in Excel While Running Excel VBA Macro Code

Got any Excel/VBA Questions? Excel Help

 

Stop Screen Flicker In Excel While Running Excel VBA Macro Code.  

If you record Excel macros, as apposed to writing them, you will often wish to stop the screen flicker caused by your macro selecting cells and Worksheets. Even inexperienced VBA coders, that write their own code, often and up with the same problem due to their code being full of Select, Selection, Activate etc. Not only is it off-putting for the end user but it also causes macros to run much slower.

Stop Excel Screen Flicker

The long term aim should be to write better and more efficient code however, that is not always possible. The other option is to use a simple line of code like: Application.ScreenUpdating=False This will stop Excel having to repaint the screen each time the macro does something. To see the huge improvement that can be obtained, run the 2 macros below via Tools>Macro>Macros.

Sub SlowWithFlicker()

Dim rCell As Range

    For Each rCell In Range("A1:A15000")

        rCell.Select

    Next rCell

End Sub



Sub FastWithNoFlicker()

Dim rCell As Range

    Application.ScreenUpdating = False

        For Each rCell In Range("A1:A15000")

            rCell.Select

        Next rCell

    Application.ScreenUpdating = True

End Sub
 

See also:

Index to Excel VBA Code
SpecialCells Method
Optimize Slow VBA Code. Speeding Up Slow Excel VBA Code
Hide Excel Formulas

 

See also Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions.

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.


Gallery



stars (0 Reviews)