What is best practice in the case of using Application.ScreenUpdating?
I use it in two different ways and have seen mixed results regarding screen flicker during code runs.
Method 1:
Code: Select all
Sub Master()
Application.ScreenUpdating = False
Macro1
Macro2
Macro3
Application.ScreenUpdating = True
End Sub
Sub Macro1()
...
End Sub
Sub Macro2()
...
End Sub
Sub Macro3()
...
End Sub
Code: Select all
Sub Master()
Macro1
Macro2
Macro3
End Sub
Sub Macro1()
Application.ScreenUpdating = False
...
Application.ScreenUpdating = True
End Sub
Sub Macro2()
Application.ScreenUpdating = False
...
Application.ScreenUpdating = True
End Sub
Sub Macro3()
Application.ScreenUpdating = False
...
Application.ScreenUpdating = True
End Sub
I recall also in pre- ribbon versions of Excel that if ScreenUpdating was switched off and a MsgBox (or GetOpenFileName dialog, for example) was displayed, that if you dragged it, it would leave a trail of unrefreshed duplicates behind it (similar to the bouncing winner msg after playing the old Solitaire game). However in the ribbon versions of Excel, this seems to have changed? With ScreenUpdating off, the duplication trails are not an issue anymore. Dragging dialogs now leaves a clean screen. Is this an improvement on Microsoft's side or just an OS improvement?
TX