Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default setting all sheets in workbook to same zoom level?

I'd like to add a button to my application that sets all the sheet zooms to
a zoom level as specified by the user. The below works, but is there a
simpler way?

Sub Zoom()
Dim WS As Worksheet, OrgWS As Worksheet
Application.ScreenUpdating = False
Set OrgWS = ActiveSheet
For Each WS In Application.Worksheets
WS.Select
ActiveWindow.Zoom = 85
Next WS
OrgWS.Select
End Sub

The above would have problems with hidden sheets. So to work properly it
would have to be modified to detect them, then to rehide them.

Don <www.donwiss.com (e-mail link at home page bottom).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default setting all sheets in workbook to same zoom level?

Hi Don,
Try this:
Sub Zoom()
Dim WS As Worksheet, OrgWS As Worksheet
Application.ScreenUpdating = False
Set OrgWS = ActiveSheet
For Each WS In Worksheets
If WS.Visible Then
WS.Select
ActiveWindow.Zoom = 85
Else
WS.Visible = xlSheetVisible
WS.Select
ActiveWindow.Zoom = 85
WS.Visible = xlSheetHidden
End If
Next WS
OrgWS.Select
End Sub

Rgds,

halim

Don Wiss menuliskan:
I'd like to add a button to my application that sets all the sheet zooms to
a zoom level as specified by the user. The below works, but is there a
simpler way?

Sub Zoom()
Dim WS As Worksheet, OrgWS As Worksheet
Application.ScreenUpdating = False
Set OrgWS = ActiveSheet
For Each WS In Application.Worksheets
WS.Select
ActiveWindow.Zoom = 85
Next WS
OrgWS.Select
End Sub

The above would have problems with hidden sheets. So to work properly it
would have to be modified to detect them, then to rehide them.

Don <www.donwiss.com (e-mail link at home page bottom).


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing zoom level automatically Xt Excel Worksheet Functions 2 October 23rd 09 07:19 PM
Zoom level Habicht Excel Discussion (Misc queries) 2 June 13th 08 06:08 PM
Zoom level Fotis Excel Discussion (Misc queries) 1 July 7th 06 04:43 PM
setting Page Setup on a workbook level [email protected] Excel Discussion (Misc queries) 1 June 14th 06 06:07 PM
Setting zoom of 2 sheets equal jbl25[_5_] Excel Programming 2 June 28th 05 05:40 PM


All times are GMT +1. The time now is 01:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"