View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Preset Display Setting in Auto Open

Hi Phil

The best thing to do is to rebuild your existing code.
You also using zoom in your old Auto open i see.

The code I post as a example will change the zoom in each sheet
depending of the display setting of the user.
If you run your old code after that it be of no use.

I use also a loop in my code

For Each sh In ThisWorkbook.Worksheets
sh.Select
ActiveWindow.zoom = zoomnumber
Next

Add your stuff in this loop

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Phil Hageman" wrote in message ...
Ron,

Below is the existing, "old", Auto_Open.
1. Would I simply change the name of the "old" sub?
2. Would all these things work the same under a different sub name?
3. Would I add an instruction in the "new" Auto_Open to execute the renamed "old" sub?

Option Explicit
Sub Auto_Open()
'This code establishes the screen protocol for on-screen presentations.
Dim WS As Worksheet
Application.ScreenUpdating = False 'Turns off updating so code runs faster
Application.Calculation = xlAutomatic 'Executs calculations as data is entered.
Application.DisplayFullScreen = True 'Sizes to full screen, no toolbars
For Each WS In Worksheets
If WS.Visible = xlSheetVisible Then
WS.Select
Application.Goto WS.Range("A1"), True 'Active cell is A1
ActiveWindow.DisplayGridlines = False 'Turns off gridlines
ActiveWindow.DisplayWorkbookTabs = False 'Turns off workbook tabs
ActiveWindow.DisplayHeadings = False 'Turns off column & row headings
ActiveWindow.DisplayHorizontalScrollBar = False 'Turns off horizontal scroll bar
ActiveWindow.WindowState = xlMaximized 'Maximizes selected worksheets
ActiveWindow.View = xlNormalView
End If
Next

Worksheets("Customer").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 62 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
ActiveSheet.PageSetup.TopMargin = Application.InchesToPoints(0.5) 'Sets top header at .5" for proper print fit.
Worksheets("Rationale11").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
Worksheets("Rationale12").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
Worksheets("Rationale13").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling

Worksheets("Financial").Select 'Selects the Financial worksheet
ActiveWindow.Zoom = 62 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***

ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
ActiveSheet.PageSetup.TopMargin = Application.InchesToPoints(0.5) 'Sets top header at .5" for proper print fit.
Worksheets("Rationale21").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
Worksheets("Rationale22").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
Worksheets("Rationale23").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling

Worksheets("Learning and Growth").Select 'Selects the L&G worksheet
ActiveWindow.Zoom = 62 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
ActiveSheet.PageSetup.TopMargin = Application.InchesToPoints(0.5) 'Sets top header at .5" for proper print fit.
Worksheets("Rationale31").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
Worksheets("Rationale32").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
Worksheets("Rationale33").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling

Worksheets("Internal Business Process").Select 'Selects the IBP worksheet
ActiveWindow.Zoom = 62 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
ActiveSheet.PageSetup.TopMargin = Application.InchesToPoints(0.5) 'Sets top header at .5" for proper print fit.
Worksheets("Rationale41").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
Worksheets("Rationale42").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling
Worksheets("Rationale43").Select 'Selects the Customer worksheet
ActiveWindow.Zoom = 67 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 91 'Sets print scaling

Worksheets("Scorecard").Select 'To open the workbook on the Scorecard worksheet
ActiveWindow.Zoom = 62 'Sizes the window to 62% ***Zoom code in Scorecard Module and Module2 also***
ActiveWindow.DisplayHeadings = False 'Turns off row and column headings
ActiveSheet.PageSetup.Zoom = 95 'Sets print scaling
ActiveSheet.PageSetup.TopMargin = Application.InchesToPoints(0#) 'Sets top header at 0.0" for proper print fit.

ThisWorkbook.Colors(7) = RGB(255, 124, 128) 'To change default color pink (index number 7) to light red (for charts)
Application.AutoPercentEntry = True 'In percent formatted cells, returns %, if decimal or whole number entered.
Application.ScreenUpdating = True 'Restore screen updating capabilities
End Sub