Page setup for multiple pages

  • Thread starter Thread starter Lynn
  • Start date Start date
L

Lynn

I want my macro to apply the same print settings to
multiple sheets in my workbook. I have tried the
following code but get an error in the first line.

With ActiveWorkbook.Worksheets(Array
("Reference", "IncomeStatement", "CashStatement
1", "CashStatement 2")).PageSetup
.PaperSize = xlPaperLegal
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

Any suggestions are much appreciated.
 
Lynn,

Not sure - but I think you need to loop through the sheets separately.
This worked for me...

Dim x as Long
For x = 1 to 4
With ActiveWorkbook.Sheets(x).PageSetup
.PaperSize = xlPaperLegal
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Next

You could use an If or Select Case to set the worksheet names
for each x.
 
Back
Top