ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ScreenUpdating Problem (https://www.excelbanter.com/excel-programming/287491-screenupdating-problem.html)

pjhageman[_8_]

ScreenUpdating Problem
 
This code does not work unless I comment out the ScreenUpdating lines.
Can someone help correct this problem?
Thanks, Phil

Sub GoToStrategy1() 'Positions the first strategy on screen
Application.ScreenUpdating = False
Range("A1").Select
ActiveWindow.Zoom = True
ActiveWindow.Zoom = 62 'Sizes the window to 62%
Application.ScreenUpdating = True
End Sub


---
Message posted from http://www.ExcelForum.com/


Rocky McKinley

ScreenUpdating Problem
 
It works fine on Excel 2002 & WinXP Pro, is there a "Change Event" firing
when selecting "A1" that calls other code that could be interfering? It's
just a hunch but you could try turning "off " and then "on" events while
running the code.

I don't think you need the "ActiveWindow.Zoom = True", this makes the zoom
400% which is unnecessary because it really ends up at 62% anyway.

Sub GoToStrategy1() 'Positions the first strategy on screen
Application.EnableEvents = False
Application.ScreenUpdating = False
Range("A1").Select
'ActiveWindow.Zoom = True
ActiveWindow.Zoom = 62 'Sizes the window to 62%
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub


--
Regards,
Rocky McKinley


"pjhageman " wrote in message
...
This code does not work unless I comment out the ScreenUpdating lines.
Can someone help correct this problem?
Thanks, Phil

Sub GoToStrategy1() 'Positions the first strategy on screen
Application.ScreenUpdating = False
Range("A1").Select
ActiveWindow.Zoom = True
ActiveWindow.Zoom = 62 'Sizes the window to 62%
Application.ScreenUpdating = True
End Sub


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 01:16 PM.

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