Screenupdating

confusion123

Active Member
Joined
Jul 27, 2014
Messages
400
The code below is in a worksheet.

When I put in a breakpoint as shown, why is ScreenUpdating set to TRUE, when I specifically set it to False?

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Application.ScreenUpdating = False

Dim a As Integer

a = 10 'BREAKPOINT SHOWS Application.ScreenUpdating = TRUE!!!

Application.ScreenUpdating = True

End Sub
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
con123,

It shouldn't be true and it probably isn't.

If you are checking its state in the Immediate pane with ?Application.ScreenUpdating then it will say True

Try testing with MsgBox or Debug.Print as below.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'MsgBox Application.ScreenUpdating
Debug.Print Application.ScreenUpdating
Application.ScreenUpdating = False


Dim a As Integer
Debug.Print Application.ScreenUpdating
'MsgBox Application.ScreenUpdating
a = 10 'BREAKPOINT SHOWS Application.ScreenUpdating = TRUE!!!
'MsgBox Application.ScreenUpdating
Debug.Print Application.ScreenUpdating
Application.ScreenUpdating = True


End Sub

Hope that helps.
 
Upvote 0
Thanks.

Yes, indeed I was "checking" using

Code:
? Application.Screenupdating

Your suggestion shows False, as it should be, so any ideas why using the Immediate window shows True?
 
Upvote 0
I'm sorry but I have no idea as to why this is the case.

Even if you set Application.ScreenUpdating = False from within the Immediate window it still returns True if you query it from Immediate.

If you find an explanation then please post back.
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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