ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ScreenUpdating = FALSE (https://www.excelbanter.com/excel-programming/409496-screenupdating-%3D-false.html)

Cinque Terra

ScreenUpdating = FALSE
 
I would like to turn off screen updating while my sub runs. If I turn off
screen updating within the sub, it does not turn off. If I turn off screen
updating in a second sub that calls the first, it turns off.

Any thoughts why I have to use the 2nd sub - I would prefer to accomplish
this within a single sub.

Sub Aggregate()
Dim ...
Application.EnableEvents = False
Application.ScreenUpdating = False
Load frm_Offsets
"do VBA stuff"
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

Sub Spread_test()
Application.ScreenUpdating = False
Call Aggregate
End Sub

Thanks in advance!

Jim Rech[_2_]

ScreenUpdating = FALSE
 
It should work the same in either case. There's got to be something else
going on. Anyway the ScreenUpdating in Aggregate is getting skipped? Can
you repro this in a simpler example?

--
Jim
"Cinque Terra" wrote in message
...
I would like to turn off screen updating while my sub runs. If I turn off
screen updating within the sub, it does not turn off. If I turn off
screen
updating in a second sub that calls the first, it turns off.

Any thoughts why I have to use the 2nd sub - I would prefer to accomplish
this within a single sub.

Sub Aggregate()
Dim ...
Application.EnableEvents = False
Application.ScreenUpdating = False
Load frm_Offsets
"do VBA stuff"
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

Sub Spread_test()
Application.ScreenUpdating = False
Call Aggregate
End Sub

Thanks in advance!




Gary Keramidas

ScreenUpdating = FALSE
 
it's hard to say. try adding something like this and see if it's ever set to
false

Debug.Print Application.ScreenUpdating
Application.EnableEvents = False
Application.ScreenUpdating = False
Debug.Print Application.ScreenUpdating

--


Gary


"Cinque Terra" wrote in message
...
I would like to turn off screen updating while my sub runs. If I turn off
screen updating within the sub, it does not turn off. If I turn off screen
updating in a second sub that calls the first, it turns off.

Any thoughts why I have to use the 2nd sub - I would prefer to accomplish
this within a single sub.

Sub Aggregate()
Dim ...
Application.EnableEvents = False
Application.ScreenUpdating = False
Load frm_Offsets
"do VBA stuff"
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

Sub Spread_test()
Application.ScreenUpdating = False
Call Aggregate
End Sub

Thanks in advance!





All times are GMT +1. The time now is 09:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com