mscallisto
Technical User
I have a spreadsheet with 70 worksheets each of which I want to set the print area as well set it to landscape and fit to 1 page wide by 1 page high.
The following code doesn't seem to work, even when I added a save between iterations.
All help accepted!
The following code doesn't seem to work, even when I added a save between iterations.
All help accepted!
Code:
Sub SetSheetAttributes()
Dim WS As Worksheet
Dim ct As Integer
Application.ScreenUpdating = False
For Each WS In Worksheets
ct = ct + 1
Application.StatusBar = "( " & WS.Name & " ) Worksheet# " & ct
Range("A1:N20").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$N$20"
Range("A1").Select
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
If ct = 7 Then
ActiveWorkbook.Save
End If
Next WS
End Sub