Screen Updating

Abulafia

Board Regular
Joined
Jun 15, 2004
Messages
66
I have the following code:

Code:
Application.ScreenUpdating = False
        Range(nrColumn1).ClearContents
        Range(nrColumn2).ClearContents
Application.ScreenUpdating = True

I would expect this to clear the two columns without showing me it happen but, when I run the code, I have to watch as the screen changes cell by cell to empty values.

Why is the ScreenUpdating property not working in this instance?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Abulafia,

That's bizar. :confused: For me it works fine
Try turning off (and on!) Application.Calculation

Code:
nrColumn1 = "A1:A65536"
nrColumn2 = "B1:B65536"
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
        Range(nrColumn1).ClearContents
        Range(nrColumn2).ClearContents
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True

kind regards,
Erik
 
Upvote 0
Thanks. That didn't work either but you made me think what the reason was.

I am using the Target argument of the Worksheet_Change event to determine whether one of the columns has values changed between a range and, if so, run a subroutine. The first column I'm clering is tied to the Change event and that's why. I'll put a boolean argument around all this and that should sort it.

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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