PDA

View Full Version : Solved: Adjusting all worksheets except the first



jacksonworld
02-26-2008, 06:50 PM
Here is a simple problem for someone kind enough to help.

I am wanting to to adjust the zoom and page setup for all sheets except the first one.

Below is the code for dumping for changing the zoom and page setup. All I require is the preceding few lines.

Thank you.

ActiveWindow.Zoom = 85
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 2
End With

lucas
02-26-2008, 09:47 PM
This will not affect a sheet named sheet1....not necessarily the first sheet in the workbook though....let me know if it needs to be the first sheet in the workbook......

Option Explicit
Sub formatSheets()
Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In Worksheets
If ws.Name <> "Sheet1" Then
ws.Activate
ActiveWindow.Zoom = 85
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 2
End With
End If
Next
Application.DisplayAlerts = True
End Sub

jacksonworld
02-26-2008, 10:05 PM
That will do nicely. Thanks for your help.