Zoom to fit the page width

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
 
J

Jim Cone

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top