Zoom to fit the page width

  • Thread starter Thread starter DaveFinn
  • Start date Start date
D

DaveFinn

Hi,

I have an excel workbook with multiple sheets. It is been used on different
computers and I would like my workbook to zoom always to right screen width.
How can I do this?

I have freezed panes on top of every sheet with a background picture that
has a width of 33,52 cm. I would like to have screen fitted always to that
width.

I have been trying following code in ThisWorkbook but it doesn't work at
all. It only opens the coversheet and zooms it and has no effect on any other
sheet.

Private Sub Workbook_Open()

Me.Sheets("Cover").Activate
Application.ActiveSheet.Range("A1:M6").Select
Application.ActiveWindow.Zoom = True
Me.Range("A7").Select

End Sub
 
Well, ActiveSheet only applies to the active sheet. <g>
Try the following slightly modified code using the Activate event instead of the Open event.
'--
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Sh.Range("A1:M6").Select
Application.ActiveWindow.Zoom = True
Sh.Range("A7").Select
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"DaveFinn"
wrote in message
Hi,
I have an excel workbook with multiple sheets. It is been used on different
computers and I would like my workbook to zoom always to right screen width.
How can I do this?
I have freezed panes on top of every sheet with a background picture that
has a width of 33,52 cm. I would like to have screen fitted always to that
width.
I have been trying following code in ThisWorkbook but it doesn't work at
all. It only opens the coversheet and zooms it and has no effect on any other
sheet
..
Private Sub Workbook_Open()
Me.Sheets("Cover").Activate
Application.ActiveSheet.Range("A1:M6").Select
Application.ActiveWindow.Zoom = True
Me.Range("A7").Select
End Sub
 
Back
Top