ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need Code to Set Scaling Zoom in PageSetup in Auto_Open Sub (https://www.excelbanter.com/excel-programming/295684-need-code-set-scaling-zoom-pagesetup-auto_open-sub.html)

Phil Hageman[_3_]

Need Code to Set Scaling Zoom in PageSetup in Auto_Open Sub
 
I have a user changing PageSetup scaling when opening this workbook/worksheets. Problem is, this in turn changes the print output for other users when they open the workbook €“ makes the print undersize for the page. To enforce a standard, I want to add code to change scaling in the workbook opening sequence (for PageSetup.Zoom) as follows

Worksheet Scalin
Scorecard 95
Customer 91
Financial 91
Learning and Growth 91
Internal Business Process 91

How would the following code be modified to accomplish this

Sub Auto_Open(
Dim ws As Workshee

Application.ScreenUpdating = False
Application.DisplayFullScreen = True

For Each ws In Worksheet
If ws.Visible = xlSheetVisible The
ws.Selec
Application.Goto ws.Range("A1"), True
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayWorkbookTabs = False
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayHorizontalScrollBar = False
ActiveWindow.View = xlNormalVie
End I
Nex

Worksheets("Customer").Select 'Selects the Customer workshee
ActiveWindow.Zoom = 62
Worksheets("Financial").Select
ActiveWindow.Zoom = 62
Worksheets("Learning and Growth").Selec
ActiveWindow.Zoom = 6
Worksheets("Internal Business Process").Selec
ActiveWindow.Zoom = 6
Worksheets("Scorecard").Selec
ActiveWindow.Zoom = 6

ThisWorkbook.Colors(7) = RGB(255, 124, 128
Application.AutoPercentEntry = Tru
Application.ScreenUpdating = Tru

End Su


JWolf

Need Code to Set Scaling Zoom in PageSetup in Auto_Open Sub
 
ActiveSheet.PageSetup.zoom = 95,etc.

Phil Hageman wrote:

I have a user changing PageSetup scaling when opening this workbook/worksheets. Problem is, this in turn changes the print output for other users when they open the workbook €“ makes the print undersize for the page. To enforce a standard, I want to add code to change scaling in the workbook opening sequence (for PageSetup.Zoom) as follows:

Worksheet Scaling
Scorecard 95%
Customer 91%
Financial 91%
Learning and Growth 91%
Internal Business Process 91%

How would the following code be modified to accomplish this?


Sub Auto_Open()
Dim ws As Worksheet

Application.ScreenUpdating = False
Application.DisplayFullScreen = True

For Each ws In Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select
Application.Goto ws.Range("A1"), True
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayWorkbookTabs = False
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayHorizontalScrollBar = False
ActiveWindow.View = xlNormalView
End If
Next

Worksheets("Customer").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 62
Worksheets("Financial").Select
ActiveWindow.Zoom = 62
Worksheets("Learning and Growth").Select
ActiveWindow.Zoom = 62
Worksheets("Internal Business Process").Select
ActiveWindow.Zoom = 62
Worksheets("Scorecard").Select
ActiveWindow.Zoom = 62

ThisWorkbook.Colors(7) = RGB(255, 124, 128)
Application.AutoPercentEntry = True
Application.ScreenUpdating = True

End Sub


JWolf

Need Code to Set Scaling Zoom in PageSetup in Auto_Open Sub
 
After each activewindow.zoom statement.

Phil Hageman wrote:

I recognize some of this - I tried to come up with something like this form the macro generator, but don't know how to place this in the code - where it specifies the different zoom values for the different worksheets. Can you go further with me on this?

Thanks, Phil


Phil Hageman[_3_]

Need Code to Set Scaling Zoom in PageSetup in Auto_Open Sub
 
Thank you very much for your time - this works exactly as needed. Appreciate it!


All times are GMT +1. The time now is 05:35 PM.

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