Flickering with Application.ScreenUpdating = False

djp203

Board Regular
Joined
Dec 1, 2008
Messages
89
Hi I'm using this VBA code to sort a table. The table's values coming from Formula.

Code:
Private Sub Worksheet_Calculate()
On Error Resume Next
Application.ScreenUpdating = False
With Me.Range("O19:P24")
.Sort Key1:=Me.Range("P20"), Order1:=xlDescending, Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
Application.ScreenUpdating = True
On Error GoTo 0
End Sub


However it still flickers when it runs.... any ideas?
 
Last edited:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
For anyone who may like to know

Code:
Private Sub Worksheet_Calculate()
    On Error Resume Next
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    With Me.Range("F20:G25")
        .Sort Key1:=Me.Range("G21"), Order1:=xlDescending, Header:=xlGuess _
        , OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
    End With
    Application.ScreenUpdating = True
    Application.EnableEvents = True
    On Error GoTo 0
End Sub
 
Upvote 0
Just FYI, you don't need On Error GoTo 0 before the End Sub.
 
Upvote 0
I've experienced this as well... try putting the ScreenUpdating command as the very first command in the macro. It may help; this same thing has worked for me.

Regards,
XLXRider
 
Upvote 0

Forum statistics

Threads
1,215,746
Messages
6,126,639
Members
449,325
Latest member
Hardey6ix

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top