View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
spences10 spences10 is offline
external usenet poster
 
Posts: 23
Default Changing the Zoom Property of a WorkBook without using an Array

Hi,

there is one thing i have noticed though.

i have just checked the print preview of the document and it has
changed the scaling to like 10% ?

has this anything to do with it?, this is the only this that i have
changed =0

Ken Johnson wrote:
spences10 wrote:
Faaaantastic,

thank you both



Ken Johnson wrote:
spences10 wrote:
Hi,

I am trying to write a bit of code that changes the zoom property of a
whole work book. Rather than use an array [as there are 40+ worksheets]
I want to use 'For Each' statement like

Sub ChangeZoom55()

Application.ScreenUpdating = False
Dim Sh As Worksheet

For Each Sh In Worksheets
Sh.Zoom = 55
Next

Application.ScreenUpdating = True

Sub Function

There is the added frustration of hidden worksheets, so I am not sure
if I have to run a separate bit of code to un hide the hidden sheets,
if I do have to do this is there a way in which I can hide all the
sheets which were originally hidden but not the sheets that were
visible to start with.

Any help much appreciated. Scott
= )

Hi Scott,

Helmut's right.

I tried...

Public Sub zoomAll()
Dim Sht As Worksheet
For Each Sht In ActiveWorkbook.Worksheets
Sht.Activate
ActiveWindow.Zoom = 50
Next Sht
End Sub

which worked.

Ken Johnson


You're welcome.
Thanks for the feedback

Ken Johnson